diff options
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r-- | src/bin/psql/common.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index ee1333e1ddc..07f4d22c070 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.114 2006/03/05 15:58:51 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.115 2006/03/06 19:49:20 momjian Exp $ */ #include "postgres_fe.h" #include "common.h" @@ -1329,6 +1329,29 @@ is_superuser(void) /* + * Test if the current session uses standard string literals. + * + * Note: this will correctly detect the setting only with a protocol-3.0 + * or newer backend; otherwise it will always say "false". + */ +bool +standard_strings(void) +{ + const char *val; + + if (!pset.db) + return false; + + val = PQparameterStatus(pset.db, "standard_conforming_strings"); + + if (val && strcmp(val, "on") == 0) + return true; + + return false; +} + + +/* * Return the session user of the current connection. * * Note: this will correctly detect the session user only with a |