|
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.444 2008/04/04 08:33:15 mha Exp $ |
| 13 | + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.445 2008/04/04 11:47:19 mha Exp $ |
14 | 14 | * |
15 | 15 | *-------------------------------------------------------------------- |
16 | 16 | */ |
@@ -153,7 +153,6 @@ static bool assign_stage_log_stats(bool newval, bool doit, GucSource source); |
153 | 153 | static bool assign_log_stats(bool newval, bool doit, GucSource source); |
154 | 154 | static bool assign_transaction_read_only(bool newval, bool doit, GucSource source); |
155 | 155 | static const char *assign_canonical_path(const char *newval, bool doit, GucSource source); |
156 | | -static const char *assign_backslash_quote(const char *newval, bool doit, GucSource source); |
157 | 156 | static const char *assign_timezone_abbreviations(const char *newval, bool doit, GucSource source); |
158 | 157 | static const char *show_archive_command(void); |
159 | 158 | static bool assign_tcp_keepalives_idle(int newval, bool doit, GucSource source); |
@@ -253,6 +252,23 @@ static const struct config_enum_entry xmloption_options[] = { |
253 | 252 | {NULL, 0} |
254 | 253 | }; |
255 | 254 |
|
| 255 | +/* |
| 256 | + * Although only "on", "off", and "safe_encoding" are documented, we |
| 257 | + * accept all the likely variants of "on" and "off". |
| 258 | + */ |
| 259 | +static const struct config_enum_entry backslash_quote_options[] = { |
| 260 | + {"safe_encoding", BACKSLASH_QUOTE_SAFE_ENCODING}, |
| 261 | + {"on", BACKSLASH_QUOTE_ON}, |
| 262 | + {"off", BACKSLASH_QUOTE_OFF}, |
| 263 | + {"true", BACKSLASH_QUOTE_ON}, |
| 264 | + {"false", BACKSLASH_QUOTE_OFF}, |
| 265 | + {"yes", BACKSLASH_QUOTE_ON}, |
| 266 | + {"no", BACKSLASH_QUOTE_OFF}, |
| 267 | + {"1", BACKSLASH_QUOTE_ON}, |
| 268 | + {"0", BACKSLASH_QUOTE_OFF}, |
| 269 | + {NULL, 0} |
| 270 | +}; |
| 271 | + |
256 | 272 | /* |
257 | 273 | * GUC option variables that are exported from this module |
258 | 274 | */ |
@@ -311,7 +327,6 @@ static char *syslog_ident_str; |
311 | 327 | static bool phony_autocommit; |
312 | 328 | static bool session_auth_is_superuser; |
313 | 329 | static double phony_random_seed; |
314 | | -static char *backslash_quote_string; |
315 | 330 | static char *client_encoding_string; |
316 | 331 | static char *datestyle_string; |
317 | 332 | static char *locale_collate; |
@@ -1959,15 +1974,6 @@ static struct config_string ConfigureNamesString[] = |
1959 | 1974 | "", NULL, show_archive_command |
1960 | 1975 | }, |
1961 | 1976 |
|
1962 | | - { |
1963 | | - {"backslash_quote", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, |
1964 | | - gettext_noop("Sets whether \"\\'\" is allowed in string literals."), |
1965 | | - gettext_noop("Valid values are ON, OFF, and SAFE_ENCODING.") |
1966 | | - }, |
1967 | | - &backslash_quote_string, |
1968 | | - "safe_encoding", assign_backslash_quote, NULL |
1969 | | - }, |
1970 | | - |
1971 | 1977 | { |
1972 | 1978 | {"client_encoding", PGC_USERSET, CLIENT_CONN_LOCALE, |
1973 | 1979 | gettext_noop("Sets the client's character set encoding."), |
@@ -2419,6 +2425,15 @@ static struct config_string ConfigureNamesString[] = |
2419 | 2425 |
|
2420 | 2426 | static struct config_enum ConfigureNamesEnum[] = |
2421 | 2427 | { |
| 2428 | + { |
| 2429 | + {"backslash_quote", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, |
| 2430 | + gettext_noop("Sets whether \"\\'\" is allowed in string literals."), |
| 2431 | + gettext_noop("Valid values are ON, OFF, and SAFE_ENCODING.") |
| 2432 | + }, |
| 2433 | + &backslash_quote, |
| 2434 | + BACKSLASH_QUOTE_SAFE_ENCODING, backslash_quote_options, NULL, NULL |
| 2435 | + }, |
| 2436 | + |
2422 | 2437 | { |
2423 | 2438 | {"client_min_messages", PGC_USERSET, LOGGING_WHEN, |
2424 | 2439 | gettext_noop("Sets the message levels that are sent to the client."), |
|
0 commit comments