OSDN Git Service

Cause pg_proc.probin to be declared as text, not bytea. Everything was
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 Aug 2009 04:04:12 +0000 (04:04 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 Aug 2009 04:04:12 +0000 (04:04 +0000)
already treating it as text anyway, to the point that I couldn't find anything
to change except the datatype markings in catalog/*.h.  The only effect that
the bytea declaration had was to cause byteaout() to be invoked when pg_dump
(or another client program) inspected the column value.  Since pg_dump wasn't
expecting that, but just treating what it got as text, the net result is that
dump and reload would mangle any backslashes or non-ASCII characters in the
filename string for a C-language function.  That is a very long-standing bug,
but given the lack of field complaints it doesn't seem worth trying to find
a back-patchable fix.  We'll just make this change to fix it going forward.

This change will also forestall problems after the planned change to let bytea
emit hex output instead of escaped characters.

doc/src/sgml/catalogs.sgml
src/include/catalog/catversion.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_proc.h

index 6cca974..46ac8c3 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.204 2009/08/02 22:14:51 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.205 2009/08/04 04:04:11 tgl Exp $ -->
 <!--
  Documentation of the system catalogs, directed toward PostgreSQL developers
  -->
 
      <row>
       <entry><structfield>probin</structfield></entry>
-      <entry><type>bytea</type></entry>
+      <entry><type>text</type></entry>
       <entry></entry>
       <entry>
        Additional information about how to invoke the function.
index c1b8f6b..fb6a2d2 100644 (file)
@@ -37,7 +37,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.536 2009/08/03 21:11:39 joe Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.537 2009/08/04 04:04:11 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200908031
+#define CATALOG_VERSION_NO     200908032
 
 #endif
index ce6da9a..ff5ed59 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.150 2009/08/02 22:14:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.151 2009/08/04 04:04:11 tgl Exp $
  *
  * NOTES
  *       the genbki.sh script reads this file and generates .bki
@@ -312,7 +312,7 @@ DATA(insert ( 1247 tableoid                 26 0 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
 { 1255, {"proargnames"},         1009, -1, 0, -1, 20, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
 { 1255, {"proargdefaults"},            25, -1, 0, -1, 21, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
 { 1255, {"prosrc"},                            25, -1, 0, -1, 22, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"probin"},                            17, -1, 0, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"probin"},                            25, -1, 0, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
 { 1255, {"proconfig"},           1009, -1, 0, -1, 24, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
 { 1255, {"proacl"},                      1034, -1, 0, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
 
@@ -338,7 +338,7 @@ DATA(insert ( 1255 proargmodes        1002 -1 0 -1 19 1 -1 -1 f x i f f f t 0 _null_)
 DATA(insert ( 1255 proargnames   1009 -1 0 -1 20 1 -1 -1 f x i f f f t 0 _null_));
 DATA(insert ( 1255 proargdefaults      25 -1 0 -1 21 0 -1 -1 f x i f f f t 0 _null_));
 DATA(insert ( 1255 prosrc                      25 -1 0 -1 22 0 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 probin                      17 -1 0 -1 23 0 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 probin                      25 -1 0 -1 23 0 -1 -1 f x i f f f t 0 _null_));
 DATA(insert ( 1255 proconfig     1009 -1 0 -1 24 1 -1 -1 f x i f f f t 0 _null_));
 DATA(insert ( 1255 proacl                1034 -1 0 -1 25 1 -1 -1 f x i f f f t 0 _null_));
 DATA(insert ( 1255 ctid                                27 0 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
index 89effab..d24f368 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.548 2009/08/03 21:11:39 joe Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.549 2009/08/04 04:04:12 tgl Exp $
  *
  * NOTES
  *       The script catalog/genbki.sh reads this file and generates .bki
@@ -59,7 +59,7 @@ CATALOG(pg_proc,1255) BKI_BOOTSTRAP
        text            proargdefaults; /* list of expression trees for argument
                                                                 * defaults (NULL if none) */
        text            prosrc;                 /* procedure source text */
-       bytea           probin;                 /* secondary procedure info (can be NULL) */
+       text            probin;                 /* secondary procedure info (can be NULL) */
        text            proconfig[1];   /* procedure-local GUC settings */
        aclitem         proacl[1];              /* access permissions */
 } FormData_pg_proc;