Guillaume Smet wrote: > On Wed, May 28, 2008 at 4:10 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > > If you've got any bug fixes you've been working on, now is a good time > > to get them finished up and sent in... > > Has the s/\x09/ /g patch for psql from Bruce and you been > backported to 8.3? I didn't see it on pgsql-commiters.
No. I have not backpatched it because Tom found a problem with my applied patch and did a second patch. I am attaching both patches. The second one is Tom's and I don't understand it well enough to backpatch it. -- Bruce Momjian <[EMAIL PROTECTED]> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. +
Index: src/bin/psql/mbprint.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/mbprint.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/bin/psql/mbprint.c 8 May 2008 17:04:26 -0000 1.31 --- src/bin/psql/mbprint.c 8 May 2008 19:11:36 -0000 1.32 *************** *** 3,9 **** * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.31 2008/05/08 17:04:26 momjian Exp $ * * XXX this file does not really belong in psql/. Perhaps move to libpq? * It also seems that the mbvalidate function is redundant with existing --- 3,9 ---- * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.32 2008/05/08 19:11:36 momjian Exp $ * * XXX this file does not really belong in psql/. Perhaps move to libpq? * It also seems that the mbvalidate function is redundant with existing *************** *** 321,326 **** --- 321,334 ---- linewidth += 2; ptr += 2; } + else if (*pwcs == '\t') /* Tab */ + { + do + { + *ptr++ = ' '; + linewidth++; + } while (linewidth % 8 != 0); + } else if (w < 0) /* Other control char */ { sprintf((char *) ptr, "\\x%02X", *pwcs); Index: src/test/regress/expected/prepare.out =================================================================== RCS file: /cvsroot/pgsql/src/test/regress/expected/prepare.out,v retrieving revision 1.15 retrieving revision 1.16 diff -c -r1.15 -r1.16 *** src/test/regress/expected/prepare.out 18 Jun 2007 21:40:58 -0000 1.15 --- src/test/regress/expected/prepare.out 8 May 2008 19:11:36 -0000 1.16 *************** *** 155,169 **** name | statement | parameter_types ------+-----------------------------------------------------------------+-------------------------------------------------------- q2 | PREPARE q2(text) AS | {text} ! : \x09SELECT datname, datistemplate, datallowconn ! : \x09FROM pg_database WHERE datname = $1; q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS | {text,integer,"double precision",boolean,oid,smallint} ! : \x09SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR ! : \x09ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int) ! : \x09ORDER BY unique1; q5 | PREPARE q5(int, text) AS | {integer,text} ! : \x09SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2 ! : \x09ORDER BY unique1; q6 | PREPARE q6 AS | {integer,name} : SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; q7 | PREPARE q7(unknown) AS | {path} --- 155,171 ---- name | statement | parameter_types ------+-----------------------------------------------------------------+-------------------------------------------------------- q2 | PREPARE q2(text) AS | {text} ! : SELECT datname, datistemplate, datallowconn ! : FROM pg_database WHERE datname = $1; q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS | {text,integer,"double precision",boolean,oid,smallint} ! : SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 O ! ; R ! : ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6:: ! ; int) ! : ORDER BY unique1; q5 | PREPARE q5(int, text) AS | {integer,text} ! : SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2 ! : ORDER BY unique1; q6 | PREPARE q6 AS | {integer,name} : SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; q7 | PREPARE q7(unknown) AS | {path}
Index: src/bin/psql/mbprint.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/mbprint.c,v retrieving revision 1.32 retrieving revision 1.33 diff -c -r1.32 -r1.33 *** src/bin/psql/mbprint.c 8 May 2008 19:11:36 -0000 1.32 --- src/bin/psql/mbprint.c 9 May 2008 05:25:04 -0000 1.33 *************** *** 3,9 **** * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.32 2008/05/08 19:11:36 momjian Exp $ * * XXX this file does not really belong in psql/. Perhaps move to libpq? * It also seems that the mbvalidate function is redundant with existing --- 3,9 ---- * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.33 2008/05/09 05:25:04 tgl Exp $ * * XXX this file does not really belong in psql/. Perhaps move to libpq? * It also seems that the mbvalidate function is redundant with existing *************** *** 205,216 **** * pg_wcssize takes the given string in the given encoding and returns three * values: * result_width: Width in display characters of the longest line in string ! * result_height: Number of newlines in display output ! * result_format_size: Number of bytes required to store formatted representation of string */ ! int ! pg_wcssize(unsigned char *pwcs, size_t len, int encoding, int *result_width, ! int *result_height, int *result_format_size) { int w, chlen = 0, --- 205,219 ---- * pg_wcssize takes the given string in the given encoding and returns three * values: * result_width: Width in display characters of the longest line in string ! * result_height: Number of lines in display output ! * result_format_size: Number of bytes required to store formatted ! * representation of string ! * ! * This MUST be kept in sync with pg_wcsformat! */ ! void ! pg_wcssize(unsigned char *pwcs, size_t len, int encoding, ! int *result_width, int *result_height, int *result_format_size) { int w, chlen = 0, *************** *** 241,246 **** --- 244,257 ---- linewidth += 2; format_size += 2; } + else if (*pwcs == '\t') /* Tab */ + { + do + { + linewidth++; + format_size++; + } while (linewidth % 8 != 0); + } else if (w < 0) /* Other control char */ { linewidth += 4; *************** *** 266,272 **** } if (linewidth > width) width = linewidth; ! format_size += 1; /* Set results */ if (result_width) --- 277,283 ---- } if (linewidth > width) width = linewidth; ! format_size += 1; /* For NUL char */ /* Set results */ if (result_width) *************** *** 275,288 **** *result_height = height; if (result_format_size) *result_format_size = format_size; - - return width; } /* ! * Filter out unprintable characters, companion to wcs_size. ! * Break input into lines based on \n. lineptr[i].ptr == NULL ! * indicates the end of the array. */ void pg_wcsformat(unsigned char *pwcs, size_t len, int encoding, --- 286,298 ---- *result_height = height; if (result_format_size) *result_format_size = format_size; } /* ! * Format a string into one or more "struct lineptr" lines. ! * lines[i].ptr == NULL indicates the end of the array. ! * ! * This MUST be kept in sync with pg_wcssize! */ void pg_wcsformat(unsigned char *pwcs, size_t len, int encoding, *************** *** 309,315 **** linewidth = 0; lines++; count--; ! if (count == 0) exit(1); /* Screwup */ /* make next line point to remaining memory */ --- 319,325 ---- linewidth = 0; lines++; count--; ! if (count <= 0) exit(1); /* Screwup */ /* make next line point to remaining memory */ *************** *** 346,359 **** if (encoding == PG_UTF8) sprintf((char *) ptr, "\\u%04X", utf2ucs(pwcs)); else ! /* * This case cannot happen in the current code because only * UTF-8 signals multibyte control characters. But we may need * to support it at some stage */ sprintf((char *) ptr, "\\u????"); ! ptr += 6; linewidth += 6; } --- 356,369 ---- if (encoding == PG_UTF8) sprintf((char *) ptr, "\\u%04X", utf2ucs(pwcs)); else ! { /* * This case cannot happen in the current code because only * UTF-8 signals multibyte control characters. But we may need * to support it at some stage */ sprintf((char *) ptr, "\\u????"); ! } ptr += 6; linewidth += 6; } *************** *** 370,376 **** lines->width = linewidth; *ptr++ = '\0'; /* Terminate formatted string */ ! if (count == 0) exit(1); /* Screwup */ (lines+1)->ptr = NULL; /* terminate line array */ --- 380,386 ---- lines->width = linewidth; *ptr++ = '\0'; /* Terminate formatted string */ ! if (count <= 0) exit(1); /* Screwup */ (lines+1)->ptr = NULL; /* terminate line array */ Index: src/bin/psql/mbprint.h =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/mbprint.h,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/bin/psql/mbprint.h 4 Oct 2006 00:30:06 -0000 1.11 --- src/bin/psql/mbprint.h 9 May 2008 05:25:04 -0000 1.12 *************** *** 1,4 **** ! /* $PostgreSQL: pgsql/src/bin/psql/mbprint.h,v 1.11 2006/10/04 00:30:06 momjian Exp $ */ #ifndef MBPRINT_H #define MBPRINT_H --- 1,4 ---- ! /* $PostgreSQL: pgsql/src/bin/psql/mbprint.h,v 1.12 2008/05/09 05:25:04 tgl Exp $ */ #ifndef MBPRINT_H #define MBPRINT_H *************** *** 13,18 **** extern int pg_wcswidth(const unsigned char *pwcs, size_t len, int encoding); extern void pg_wcsformat(unsigned char *pwcs, size_t len, int encoding, struct lineptr * lines, int count); ! extern int pg_wcssize(unsigned char *pwcs, size_t len, int encoding, int *width, int *height, int *format_size); #endif /* MBPRINT_H */ --- 13,19 ---- extern int pg_wcswidth(const unsigned char *pwcs, size_t len, int encoding); extern void pg_wcsformat(unsigned char *pwcs, size_t len, int encoding, struct lineptr * lines, int count); ! extern void pg_wcssize(unsigned char *pwcs, size_t len, int encoding, ! int *width, int *height, int *format_size); #endif /* MBPRINT_H */ Index: src/test/regress/expected/prepare.out =================================================================== RCS file: /cvsroot/pgsql/src/test/regress/expected/prepare.out,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** src/test/regress/expected/prepare.out 8 May 2008 19:11:36 -0000 1.16 --- src/test/regress/expected/prepare.out 9 May 2008 05:25:54 -0000 1.17 *************** *** 16,22 **** SELECT name, statement, parameter_types FROM pg_prepared_statements; name | statement | parameter_types ------+------------------------------+----------------- ! q1 | PREPARE q1 AS SELECT 1 AS a; | {} (1 row) -- should fail --- 16,22 ---- SELECT name, statement, parameter_types FROM pg_prepared_statements; name | statement | parameter_types ------+------------------------------+----------------- ! q1 | PREPARE q1 AS SELECT 1 AS a; | {} (1 row) -- should fail *************** *** 35,42 **** SELECT name, statement, parameter_types FROM pg_prepared_statements; name | statement | parameter_types ------+------------------------------+----------------- ! q1 | PREPARE q1 AS SELECT 2; | {} ! q2 | PREPARE q2 AS SELECT 2 AS b; | {} (2 rows) -- sql92 syntax --- 35,42 ---- SELECT name, statement, parameter_types FROM pg_prepared_statements; name | statement | parameter_types ------+------------------------------+----------------- ! q1 | PREPARE q1 AS SELECT 2; | {} ! q2 | PREPARE q2 AS SELECT 2 AS b; | {} (2 rows) -- sql92 syntax *************** *** 44,50 **** SELECT name, statement, parameter_types FROM pg_prepared_statements; name | statement | parameter_types ------+------------------------------+----------------- ! q2 | PREPARE q2 AS SELECT 2 AS b; | {} (1 row) DEALLOCATE PREPARE q2; --- 44,50 ---- SELECT name, statement, parameter_types FROM pg_prepared_statements; name | statement | parameter_types ------+------------------------------+----------------- ! q2 | PREPARE q2 AS SELECT 2 AS b; | {} (1 row) DEALLOCATE PREPARE q2; *************** *** 61,67 **** EXECUTE q2('regression'); datname | datistemplate | datallowconn ------------+---------------+-------------- ! regression | f | t (1 row) PREPARE q3(text, int, float, boolean, oid, smallint) AS --- 61,67 ---- EXECUTE q2('regression'); datname | datistemplate | datallowconn ------------+---------------+-------------- ! regression | f | t (1 row) PREPARE q3(text, int, float, boolean, oid, smallint) AS *************** *** 71,105 **** EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint); unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- ! 2 | 2716 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | MAEAAA | AAAAxx ! 102 | 612 | 0 | 2 | 2 | 2 | 2 | 102 | 102 | 102 | 102 | 4 | 5 | YDAAAA | OXAAAA | AAAAxx ! 802 | 2908 | 0 | 2 | 2 | 2 | 2 | 802 | 802 | 802 | 802 | 4 | 5 | WEAAAA | WHEAAA | AAAAxx ! 902 | 1104 | 0 | 2 | 2 | 2 | 2 | 902 | 902 | 902 | 902 | 4 | 5 | SIAAAA | MQBAAA | AAAAxx ! 1002 | 2580 | 0 | 2 | 2 | 2 | 2 | 2 | 1002 | 1002 | 1002 | 4 | 5 | OMAAAA | GVDAAA | AAAAxx ! 1602 | 8148 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 1602 | 1602 | 4 | 5 | QJAAAA | KBMAAA | AAAAxx ! 1702 | 7940 | 0 | 2 | 2 | 2 | 2 | 702 | 1702 | 1702 | 1702 | 4 | 5 | MNAAAA | KTLAAA | AAAAxx ! 2102 | 6184 | 0 | 2 | 2 | 2 | 2 | 102 | 102 | 2102 | 2102 | 4 | 5 | WCAAAA | WDJAAA | AAAAxx ! 2202 | 8028 | 0 | 2 | 2 | 2 | 2 | 202 | 202 | 2202 | 2202 | 4 | 5 | SGAAAA | UWLAAA | AAAAxx ! 2302 | 7112 | 0 | 2 | 2 | 2 | 2 | 302 | 302 | 2302 | 2302 | 4 | 5 | OKAAAA | ONKAAA | AAAAxx ! 2902 | 6816 | 0 | 2 | 2 | 2 | 2 | 902 | 902 | 2902 | 2902 | 4 | 5 | QHAAAA | ECKAAA | AAAAxx ! 3202 | 7128 | 0 | 2 | 2 | 2 | 2 | 202 | 1202 | 3202 | 3202 | 4 | 5 | ETAAAA | EOKAAA | AAAAxx ! 3902 | 9224 | 0 | 2 | 2 | 2 | 2 | 902 | 1902 | 3902 | 3902 | 4 | 5 | CUAAAA | UQNAAA | AAAAxx ! 4102 | 7676 | 0 | 2 | 2 | 2 | 2 | 102 | 102 | 4102 | 4102 | 4 | 5 | UBAAAA | GJLAAA | AAAAxx ! 4202 | 6628 | 0 | 2 | 2 | 2 | 2 | 202 | 202 | 4202 | 4202 | 4 | 5 | QFAAAA | YUJAAA | AAAAxx ! 4502 | 412 | 0 | 2 | 2 | 2 | 2 | 502 | 502 | 4502 | 4502 | 4 | 5 | ERAAAA | WPAAAA | AAAAxx ! 4702 | 2520 | 0 | 2 | 2 | 2 | 2 | 702 | 702 | 4702 | 4702 | 4 | 5 | WYAAAA | YSDAAA | AAAAxx ! 4902 | 1600 | 0 | 2 | 2 | 2 | 2 | 902 | 902 | 4902 | 4902 | 4 | 5 | OGAAAA | OJCAAA | AAAAxx ! 5602 | 8796 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 602 | 5602 | 4 | 5 | MHAAAA | IANAAA | AAAAxx ! 6002 | 8932 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 1002 | 6002 | 4 | 5 | WWAAAA | OFNAAA | AAAAxx ! 6402 | 3808 | 0 | 2 | 2 | 2 | 2 | 402 | 402 | 1402 | 6402 | 4 | 5 | GMAAAA | MQFAAA | AAAAxx ! 7602 | 1040 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 2602 | 7602 | 4 | 5 | KGAAAA | AOBAAA | AAAAxx ! 7802 | 7508 | 0 | 2 | 2 | 2 | 2 | 802 | 1802 | 2802 | 7802 | 4 | 5 | COAAAA | UCLAAA | AAAAxx ! 8002 | 9980 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 3002 | 8002 | 4 | 5 | UVAAAA | WTOAAA | AAAAxx ! 8302 | 7800 | 0 | 2 | 2 | 2 | 2 | 302 | 302 | 3302 | 8302 | 4 | 5 | IHAAAA | AOLAAA | AAAAxx ! 8402 | 5708 | 0 | 2 | 2 | 2 | 2 | 402 | 402 | 3402 | 8402 | 4 | 5 | ELAAAA | OLIAAA | AAAAxx ! 8602 | 5440 | 0 | 2 | 2 | 2 | 2 | 602 | 602 | 3602 | 8602 | 4 | 5 | WSAAAA | GBIAAA | AAAAxx ! 9502 | 1812 | 0 | 2 | 2 | 2 | 2 | 502 | 1502 | 4502 | 9502 | 4 | 5 | MBAAAA | SRCAAA | AAAAxx ! 9602 | 9972 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 4602 | 9602 | 4 | 5 | IFAAAA | OTOAAA | AAAAxx (29 rows) -- too few params --- 71,105 ---- EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint); unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- ! 2 | 2716 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | MAEAAA | AAAAxx ! 102 | 612 | 0 | 2 | 2 | 2 | 2 | 102 | 102 | 102 | 102 | 4 | 5 | YDAAAA | OXAAAA | AAAAxx ! 802 | 2908 | 0 | 2 | 2 | 2 | 2 | 802 | 802 | 802 | 802 | 4 | 5 | WEAAAA | WHEAAA | AAAAxx ! 902 | 1104 | 0 | 2 | 2 | 2 | 2 | 902 | 902 | 902 | 902 | 4 | 5 | SIAAAA | MQBAAA | AAAAxx ! 1002 | 2580 | 0 | 2 | 2 | 2 | 2 | 2 | 1002 | 1002 | 1002 | 4 | 5 | OMAAAA | GVDAAA | AAAAxx ! 1602 | 8148 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 1602 | 1602 | 4 | 5 | QJAAAA | KBMAAA | AAAAxx ! 1702 | 7940 | 0 | 2 | 2 | 2 | 2 | 702 | 1702 | 1702 | 1702 | 4 | 5 | MNAAAA | KTLAAA | AAAAxx ! 2102 | 6184 | 0 | 2 | 2 | 2 | 2 | 102 | 102 | 2102 | 2102 | 4 | 5 | WCAAAA | WDJAAA | AAAAxx ! 2202 | 8028 | 0 | 2 | 2 | 2 | 2 | 202 | 202 | 2202 | 2202 | 4 | 5 | SGAAAA | UWLAAA | AAAAxx ! 2302 | 7112 | 0 | 2 | 2 | 2 | 2 | 302 | 302 | 2302 | 2302 | 4 | 5 | OKAAAA | ONKAAA | AAAAxx ! 2902 | 6816 | 0 | 2 | 2 | 2 | 2 | 902 | 902 | 2902 | 2902 | 4 | 5 | QHAAAA | ECKAAA | AAAAxx ! 3202 | 7128 | 0 | 2 | 2 | 2 | 2 | 202 | 1202 | 3202 | 3202 | 4 | 5 | ETAAAA | EOKAAA | AAAAxx ! 3902 | 9224 | 0 | 2 | 2 | 2 | 2 | 902 | 1902 | 3902 | 3902 | 4 | 5 | CUAAAA | UQNAAA | AAAAxx ! 4102 | 7676 | 0 | 2 | 2 | 2 | 2 | 102 | 102 | 4102 | 4102 | 4 | 5 | UBAAAA | GJLAAA | AAAAxx ! 4202 | 6628 | 0 | 2 | 2 | 2 | 2 | 202 | 202 | 4202 | 4202 | 4 | 5 | QFAAAA | YUJAAA | AAAAxx ! 4502 | 412 | 0 | 2 | 2 | 2 | 2 | 502 | 502 | 4502 | 4502 | 4 | 5 | ERAAAA | WPAAAA | AAAAxx ! 4702 | 2520 | 0 | 2 | 2 | 2 | 2 | 702 | 702 | 4702 | 4702 | 4 | 5 | WYAAAA | YSDAAA | AAAAxx ! 4902 | 1600 | 0 | 2 | 2 | 2 | 2 | 902 | 902 | 4902 | 4902 | 4 | 5 | OGAAAA | OJCAAA | AAAAxx ! 5602 | 8796 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 602 | 5602 | 4 | 5 | MHAAAA | IANAAA | AAAAxx ! 6002 | 8932 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 1002 | 6002 | 4 | 5 | WWAAAA | OFNAAA | AAAAxx ! 6402 | 3808 | 0 | 2 | 2 | 2 | 2 | 402 | 402 | 1402 | 6402 | 4 | 5 | GMAAAA | MQFAAA | AAAAxx ! 7602 | 1040 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 2602 | 7602 | 4 | 5 | KGAAAA | AOBAAA | AAAAxx ! 7802 | 7508 | 0 | 2 | 2 | 2 | 2 | 802 | 1802 | 2802 | 7802 | 4 | 5 | COAAAA | UCLAAA | AAAAxx ! 8002 | 9980 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 3002 | 8002 | 4 | 5 | UVAAAA | WTOAAA | AAAAxx ! 8302 | 7800 | 0 | 2 | 2 | 2 | 2 | 302 | 302 | 3302 | 8302 | 4 | 5 | IHAAAA | AOLAAA | AAAAxx ! 8402 | 5708 | 0 | 2 | 2 | 2 | 2 | 402 | 402 | 3402 | 8402 | 4 | 5 | ELAAAA | OLIAAA | AAAAxx ! 8602 | 5440 | 0 | 2 | 2 | 2 | 2 | 602 | 602 | 3602 | 8602 | 4 | 5 | WSAAAA | GBIAAA | AAAAxx ! 9502 | 1812 | 0 | 2 | 2 | 2 | 2 | 502 | 1502 | 4502 | 9502 | 4 | 5 | MBAAAA | SRCAAA | AAAAxx ! 9602 | 9972 | 0 | 2 | 2 | 2 | 2 | 602 | 1602 | 4602 | 9602 | 4 | 5 | IFAAAA | OTOAAA | AAAAxx (29 rows) -- too few params *************** *** 127,148 **** SELECT * FROM q5_prep_results; unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- ! 200 | 9441 | 0 | 0 | 0 | 0 | 0 | 200 | 200 | 200 | 200 | 0 | 1 | SHAAAA | DZNAAA | HHHHxx ! 497 | 9092 | 1 | 1 | 7 | 17 | 97 | 497 | 497 | 497 | 497 | 194 | 195 | DTAAAA | SLNAAA | AAAAxx ! 1173 | 6699 | 1 | 1 | 3 | 13 | 73 | 173 | 1173 | 1173 | 1173 | 146 | 147 | DTAAAA | RXJAAA | VVVVxx ! 1849 | 8143 | 1 | 1 | 9 | 9 | 49 | 849 | 1849 | 1849 | 1849 | 98 | 99 | DTAAAA | FBMAAA | VVVVxx ! 2525 | 64 | 1 | 1 | 5 | 5 | 25 | 525 | 525 | 2525 | 2525 | 50 | 51 | DTAAAA | MCAAAA | AAAAxx ! 3201 | 7309 | 1 | 1 | 1 | 1 | 1 | 201 | 1201 | 3201 | 3201 | 2 | 3 | DTAAAA | DVKAAA | HHHHxx ! 3877 | 4060 | 1 | 1 | 7 | 17 | 77 | 877 | 1877 | 3877 | 3877 | 154 | 155 | DTAAAA | EAGAAA | AAAAxx ! 4553 | 4113 | 1 | 1 | 3 | 13 | 53 | 553 | 553 | 4553 | 4553 | 106 | 107 | DTAAAA | FCGAAA | HHHHxx ! 5229 | 6407 | 1 | 1 | 9 | 9 | 29 | 229 | 1229 | 229 | 5229 | 58 | 59 | DTAAAA | LMJAAA | VVVVxx ! 5905 | 9537 | 1 | 1 | 5 | 5 | 5 | 905 | 1905 | 905 | 5905 | 10 | 11 | DTAAAA | VCOAAA | HHHHxx ! 6581 | 4686 | 1 | 1 | 1 | 1 | 81 | 581 | 581 | 1581 | 6581 | 162 | 163 | DTAAAA | GYGAAA | OOOOxx ! 7257 | 1895 | 1 | 1 | 7 | 17 | 57 | 257 | 1257 | 2257 | 7257 | 114 | 115 | DTAAAA | XUCAAA | VVVVxx ! 7933 | 4514 | 1 | 1 | 3 | 13 | 33 | 933 | 1933 | 2933 | 7933 | 66 | 67 | DTAAAA | QRGAAA | OOOOxx ! 8609 | 5918 | 1 | 1 | 9 | 9 | 9 | 609 | 609 | 3609 | 8609 | 18 | 19 | DTAAAA | QTIAAA | OOOOxx ! 9285 | 8469 | 1 | 1 | 5 | 5 | 85 | 285 | 1285 | 4285 | 9285 | 170 | 171 | DTAAAA | TNMAAA | HHHHxx ! 9961 | 2058 | 1 | 1 | 1 | 1 | 61 | 961 | 1961 | 4961 | 9961 | 122 | 123 | DTAAAA | EBDAAA | OOOOxx (16 rows) -- unknown or unspecified parameter types: should succeed --- 127,148 ---- SELECT * FROM q5_prep_results; unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- ! 200 | 9441 | 0 | 0 | 0 | 0 | 0 | 200 | 200 | 200 | 200 | 0 | 1 | SHAAAA | DZNAAA | HHHHxx ! 497 | 9092 | 1 | 1 | 7 | 17 | 97 | 497 | 497 | 497 | 497 | 194 | 195 | DTAAAA | SLNAAA | AAAAxx ! 1173 | 6699 | 1 | 1 | 3 | 13 | 73 | 173 | 1173 | 1173 | 1173 | 146 | 147 | DTAAAA | RXJAAA | VVVVxx ! 1849 | 8143 | 1 | 1 | 9 | 9 | 49 | 849 | 1849 | 1849 | 1849 | 98 | 99 | DTAAAA | FBMAAA | VVVVxx ! 2525 | 64 | 1 | 1 | 5 | 5 | 25 | 525 | 525 | 2525 | 2525 | 50 | 51 | DTAAAA | MCAAAA | AAAAxx ! 3201 | 7309 | 1 | 1 | 1 | 1 | 1 | 201 | 1201 | 3201 | 3201 | 2 | 3 | DTAAAA | DVKAAA | HHHHxx ! 3877 | 4060 | 1 | 1 | 7 | 17 | 77 | 877 | 1877 | 3877 | 3877 | 154 | 155 | DTAAAA | EAGAAA | AAAAxx ! 4553 | 4113 | 1 | 1 | 3 | 13 | 53 | 553 | 553 | 4553 | 4553 | 106 | 107 | DTAAAA | FCGAAA | HHHHxx ! 5229 | 6407 | 1 | 1 | 9 | 9 | 29 | 229 | 1229 | 229 | 5229 | 58 | 59 | DTAAAA | LMJAAA | VVVVxx ! 5905 | 9537 | 1 | 1 | 5 | 5 | 5 | 905 | 1905 | 905 | 5905 | 10 | 11 | DTAAAA | VCOAAA | HHHHxx ! 6581 | 4686 | 1 | 1 | 1 | 1 | 81 | 581 | 581 | 1581 | 6581 | 162 | 163 | DTAAAA | GYGAAA | OOOOxx ! 7257 | 1895 | 1 | 1 | 7 | 17 | 57 | 257 | 1257 | 2257 | 7257 | 114 | 115 | DTAAAA | XUCAAA | VVVVxx ! 7933 | 4514 | 1 | 1 | 3 | 13 | 33 | 933 | 1933 | 2933 | 7933 | 66 | 67 | DTAAAA | QRGAAA | OOOOxx ! 8609 | 5918 | 1 | 1 | 9 | 9 | 9 | 609 | 609 | 3609 | 8609 | 18 | 19 | DTAAAA | QTIAAA | OOOOxx ! 9285 | 8469 | 1 | 1 | 5 | 5 | 85 | 285 | 1285 | 4285 | 9285 | 170 | 171 | DTAAAA | TNMAAA | HHHHxx ! 9961 | 2058 | 1 | 1 | 1 | 1 | 61 | 961 | 1961 | 4961 | 9961 | 122 | 123 | DTAAAA | EBDAAA | OOOOxx (16 rows) -- unknown or unspecified parameter types: should succeed *************** *** 152,175 **** SELECT * FROM road WHERE thepath = $1; SELECT name, statement, parameter_types FROM pg_prepared_statements ORDER BY name; ! name | statement | parameter_types ! ------+-----------------------------------------------------------------+-------------------------------------------------------- ! q2 | PREPARE q2(text) AS | {text} ! : SELECT datname, datistemplate, datallowconn ! : FROM pg_database WHERE datname = $1; ! q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS | {text,integer,"double precision",boolean,oid,smallint} ! : SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 O ! ; R ! : ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6:: ! ; int) ! : ORDER BY unique1; ! q5 | PREPARE q5(int, text) AS | {integer,text} ! : SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2 ! : ORDER BY unique1; ! q6 | PREPARE q6 AS | {integer,name} ! : SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; ! q7 | PREPARE q7(unknown) AS | {path} ! : SELECT * FROM road WHERE thepath = $1; (5 rows) -- test DEALLOCATE ALL; --- 152,173 ---- SELECT * FROM road WHERE thepath = $1; SELECT name, statement, parameter_types FROM pg_prepared_statements ORDER BY name; ! name | statement | parameter_types ! ------+---------------------------------------------------------------------+-------------------------------------------------------- ! q2 | PREPARE q2(text) AS | {text} ! : SELECT datname, datistemplate, datallowconn ! : FROM pg_database WHERE datname = $1; ! q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS | {text,integer,"double precision",boolean,oid,smallint} ! : SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR ! : ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int) ! : ORDER BY unique1; ! q5 | PREPARE q5(int, text) AS | {integer,text} ! : SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2 ! : ORDER BY unique1; ! q6 | PREPARE q6 AS | {integer,name} ! : SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; ! q7 | PREPARE q7(unknown) AS | {path} ! : SELECT * FROM road WHERE thepath = $1; (5 rows) -- test DEALLOCATE ALL;
-- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches