* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.444 2008/04/04 08:33:15 mha Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.445 2008/04/04 11:47:19 mha Exp $
*
*--------------------------------------------------------------------
*/
static bool assign_log_stats(bool newval, bool doit, GucSource source);
static bool assign_transaction_read_only(bool newval, bool doit, GucSource source);
static const char *assign_canonical_path(const char *newval, bool doit, GucSource source);
-static const char *assign_backslash_quote(const char *newval, bool doit, GucSource source);
static const char *assign_timezone_abbreviations(const char *newval, bool doit, GucSource source);
static const char *show_archive_command(void);
static bool assign_tcp_keepalives_idle(int newval, bool doit, GucSource source);
};
/*
+ * Although only "on", "off", and "safe_encoding" are documented, we
+ * accept all the likely variants of "on" and "off".
+ */
+static const struct config_enum_entry backslash_quote_options[] = {
+ {"safe_encoding", BACKSLASH_QUOTE_SAFE_ENCODING},
+ {"on", BACKSLASH_QUOTE_ON},
+ {"off", BACKSLASH_QUOTE_OFF},
+ {"true", BACKSLASH_QUOTE_ON},
+ {"false", BACKSLASH_QUOTE_OFF},
+ {"yes", BACKSLASH_QUOTE_ON},
+ {"no", BACKSLASH_QUOTE_OFF},
+ {"1", BACKSLASH_QUOTE_ON},
+ {"0", BACKSLASH_QUOTE_OFF},
+ {NULL, 0}
+};
+
+/*
* GUC option variables that are exported from this module
*/
#ifdef USE_ASSERT_CHECKING
static bool phony_autocommit;
static bool session_auth_is_superuser;
static double phony_random_seed;
-static char *backslash_quote_string;
static char *client_encoding_string;
static char *datestyle_string;
static char *locale_collate;
},
{
- {"backslash_quote", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
- gettext_noop("Sets whether \"\\'\" is allowed in string literals."),
- gettext_noop("Valid values are ON, OFF, and SAFE_ENCODING.")
- },
- &backslash_quote_string,
- "safe_encoding", assign_backslash_quote, NULL
- },
-
- {
{"client_encoding", PGC_USERSET, CLIENT_CONN_LOCALE,
gettext_noop("Sets the client's character set encoding."),
NULL,
static struct config_enum ConfigureNamesEnum[] =
{
{
+ {"backslash_quote", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+ gettext_noop("Sets whether \"\\'\" is allowed in string literals."),
+ gettext_noop("Valid values are ON, OFF, and SAFE_ENCODING.")
+ },
+ &backslash_quote,
+ BACKSLASH_QUOTE_SAFE_ENCODING, backslash_quote_options, NULL, NULL
+ },
+
+ {
{"client_min_messages", PGC_USERSET, LOGGING_WHEN,
gettext_noop("Sets the message levels that are sent to the client."),
gettext_noop("Valid values are DEBUG5, DEBUG4, DEBUG3, DEBUG2, "