|
10 | 10 | * Written by Peter Eisentraut <peter_e@gmx.net>.
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.368 2007/01/16 18:26:02 alvherre Exp $ |
| 13 | + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.369 2007/01/19 16:58:46 petere Exp $ |
14 | 14 | *
|
15 | 15 | *--------------------------------------------------------------------
|
16 | 16 | */
|
|
61 | 61 | #include"utils/pg_locale.h"
|
62 | 62 | #include"utils/ps_status.h"
|
63 | 63 | #include"utils/tzparser.h"
|
| 64 | +#include"utils/xml.h" |
64 | 65 |
|
65 | 66 | #ifndefPG_KRB_SRVTAB
|
66 | 67 | #definePG_KRB_SRVTAB ""
|
@@ -142,6 +143,7 @@ static bool assign_transaction_read_only(bool newval, bool doit, GucSource sourc
|
142 | 143 | staticconstchar*assign_canonical_path(constchar*newval,booldoit,GucSourcesource);
|
143 | 144 | staticconstchar*assign_backslash_quote(constchar*newval,booldoit,GucSourcesource);
|
144 | 145 | staticconstchar*assign_timezone_abbreviations(constchar*newval,booldoit,GucSourcesource);
|
| 146 | +staticconstchar*assign_xmlbinary(constchar*newval,booldoit,GucSourcesource); |
145 | 147 |
|
146 | 148 | staticboolassign_tcp_keepalives_idle(intnewval,booldoit,GucSourcesource);
|
147 | 149 | staticboolassign_tcp_keepalives_interval(intnewval,booldoit,GucSourcesource);
|
@@ -229,6 +231,7 @@ static char *timezone_abbreviations_string;
|
229 | 231 | staticchar*XactIsoLevel_string;
|
230 | 232 | staticchar*data_directory;
|
231 | 233 | staticchar*custom_variable_classes;
|
| 234 | +staticchar*xmlbinary_string; |
232 | 235 | staticintmax_function_args;
|
233 | 236 | staticintmax_index_keys;
|
234 | 237 | staticintmax_identifier_length;
|
@@ -2279,6 +2282,15 @@ static struct config_string ConfigureNamesString[] =
|
2279 | 2282 | NULL,assign_canonical_path,NULL
|
2280 | 2283 | },
|
2281 | 2284 |
|
| 2285 | +{ |
| 2286 | +{"xmlbinary",PGC_USERSET,CLIENT_CONN_STATEMENT, |
| 2287 | +gettext_noop("Sets how binary values are to be encoded in XML."), |
| 2288 | +gettext_noop("Valid values are BASE64 and HEX.") |
| 2289 | +}, |
| 2290 | +&xmlbinary_string, |
| 2291 | +"base64",assign_xmlbinary,NULL |
| 2292 | +}, |
| 2293 | + |
2282 | 2294 | /* End-of-list marker */
|
2283 | 2295 | {
|
2284 | 2296 | {NULL,0,0,NULL,NULL},NULL,NULL,NULL,NULL
|
@@ -6475,6 +6487,24 @@ pg_timezone_abbrev_initialize(void)
|
6475 | 6487 | }
|
6476 | 6488 | }
|
6477 | 6489 |
|
| 6490 | +staticconstchar* |
| 6491 | +assign_xmlbinary(constchar*newval,booldoit,GucSourcesource) |
| 6492 | +{ |
| 6493 | +XmlBinaryTypexb; |
| 6494 | + |
| 6495 | +if (pg_strcasecmp(newval,"base64")==0) |
| 6496 | +xb=XMLBINARY_BASE64; |
| 6497 | +elseif (pg_strcasecmp(newval,"hex")==0) |
| 6498 | +xb=XMLBINARY_HEX; |
| 6499 | +else |
| 6500 | +returnNULL;/* reject */ |
| 6501 | + |
| 6502 | +if (doit) |
| 6503 | +xmlbinary=xb; |
| 6504 | + |
| 6505 | +returnnewval; |
| 6506 | +} |
| 6507 | + |
6478 | 6508 | staticbool
|
6479 | 6509 | assign_tcp_keepalives_idle(intnewval,booldoit,GucSourcesource)
|
6480 | 6510 | {
|
|