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 de8e3a567e55fa2818c8f0a19db72e951e6df6d6..aada255cf16ef91a4289686ab46b341da7eb338b 100644 (file)
 
      <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 1f1c9fb95b116bc00c2052fd9539783491f7facc..0258764a899e32fe116d54dba4cfda111d4df295 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200908031
+#define CATALOG_VERSION_NO     200908032
 
 #endif
index 47efc65689a3d2ac4903231bbed400919aed9f1b..f5ea9810727e577079847a23f1f7300504eed4f8 100644 (file)
@@ -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 45dc65f2da9288f2c9da43b6f2328510bf677337..2040e772dd1c3bddb7b878e4dc7dc5d331e0e7da 100644 (file)
@@ -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;