aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/common.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-03-06 19:49:20 +0000
committerBruce Momjian <bruce@momjian.us>2006-03-06 19:49:20 +0000
commit19c21d115d221d9738afad142f2886dfd3cc40de (patch)
treef5a4a3f11ae8a6efe639a8717f5fa2c267dbd7b0 /src/bin/psql/common.c
parenta9c1047ebdde533949fd8096c8ac1eca5e821292 (diff)
downloadpostgresql-19c21d115d221d9738afad142f2886dfd3cc40de.tar.gz
postgresql-19c21d115d221d9738afad142f2886dfd3cc40de.zip
Enable standard_conforming_strings to be turned on.
Kevin Grittner
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r--src/bin/psql/common.c25
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