Skip to content

Commit f192e4a

Browse files
committed
Cause pg_proc.probin to be declared as text, not bytea. Everything was
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.
1 parent be6bca2 commit f192e4a

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.204 2009/08/02 22:14:51 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.205 2009/08/04 04:04:11 tgl Exp $ -->
22
<!--
33
Documentation of the system catalogs, directed toward PostgreSQL developers
44
-->
@@ -3841,7 +3841,7 @@
38413841

38423842
<row>
38433843
<entry><structfield>probin</structfield></entry>
3844-
<entry><type>bytea</type></entry>
3844+
<entry><type>text</type></entry>
38453845
<entry></entry>
38463846
<entry>
38473847
Additional information about how to invoke the function.

src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.536 2009/08/03 21:11:39 joe Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.537 2009/08/04 04:04:11 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 200908031
56+
#define CATALOG_VERSION_NO 200908032
5757

5858
#endif

src/include/catalog/pg_attribute.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.150 2009/08/02 22:14:52 tgl Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.151 2009/08/04 04:04:11 tgl Exp $
1212
*
1313
* NOTES
1414
* 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_));
312312
{ 1255, {"proargnames"}, 1009, -1, 0, -1, 20, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
313313
{ 1255, {"proargdefaults"}, 25, -1, 0, -1, 21, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
314314
{ 1255, {"prosrc"}, 25, -1, 0, -1, 22, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
315-
{ 1255, {"probin"}, 17, -1, 0, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
315+
{ 1255, {"probin"}, 25, -1, 0, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
316316
{ 1255, {"proconfig"}, 1009, -1, 0, -1, 24, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
317317
{ 1255, {"proacl"}, 1034, -1, 0, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
318318

@@ -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_)
338338
DATA(insert ( 1255 proargnames 1009 -1 0 -1 20 1 -1 -1 f x i f f f t 0 _null_));
339339
DATA(insert ( 1255 proargdefaults 25 -1 0 -1 21 0 -1 -1 f x i f f f t 0 _null_));
340340
DATA(insert ( 1255 prosrc 25 -1 0 -1 22 0 -1 -1 f x i f f f t 0 _null_));
341-
DATA(insert ( 1255 probin 17 -1 0 -1 23 0 -1 -1 f x i f f f t 0 _null_));
341+
DATA(insert ( 1255 probin 25 -1 0 -1 23 0 -1 -1 f x i f f f t 0 _null_));
342342
DATA(insert ( 1255 proconfig 1009 -1 0 -1 24 1 -1 -1 f x i f f f t 0 _null_));
343343
DATA(insert ( 1255 proacl 1034 -1 0 -1 25 1 -1 -1 f x i f f f t 0 _null_));
344344
DATA(insert ( 1255 ctid 27 0 0 6 -1 0 -1 -1 f p s t f f t 0 _null_));

src/include/catalog/pg_proc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.548 2009/08/03 21:11:39 joe Exp $
10+
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.549 2009/08/04 04:04:12 tgl Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -59,7 +59,7 @@ CATALOG(pg_proc,1255) BKI_BOOTSTRAP
5959
text proargdefaults; /* list of expression trees for argument
6060
* defaults (NULL if none) */
6161
text prosrc; /* procedure source text */
62-
bytea probin; /* secondary procedure info (can be NULL) */
62+
text probin; /* secondary procedure info (can be NULL) */
6363
text proconfig[1]; /* procedure-local GUC settings */
6464
aclitem proacl[1]; /* access permissions */
6565
} FormData_pg_proc;

0 commit comments

Comments
 (0)