1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

Enable standard_conforming_strings to be turned on.

Kevin Grittner
This commit is contained in:
Bruce Momjian
2006-03-06 19:49:20 +00:00
parent a9c1047ebd
commit 19c21d115d
11 changed files with 294 additions and 112 deletions

View File

@@ -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"
@@ -1328,6 +1328,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.
*