Cause pg_proc.probin to be declared as text, not bytea. Everything was
authorTom Lane
Tue, 4 Aug 2009 04:04:12 +0000 (04:04 +0000)
committerTom Lane
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 6cca97498172310e578ea127f5605bfa2a2ef5ef..46ac8c39442e1e1bbef83820e4abb4a90e951d31 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
      
       probin
-      bytea
+      text
       
       
        Additional information about how to invoke the function.
index c1b8f6b6a89226c8d1cf19fe480c90c3fa255869..fb6a2d25eb259ef3c08ade1f28c71bc9c5fba65e 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 ce6da9acdf49fbfcc6590d71c7e6b9d697472f6a..ff5ed5981fe02ad32abc348603f7b881e54894e4 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 89effab149159a973b239d5a82726fa8f6485221..d24f36812193dedc599f55dfd37020982d3a9a08 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;