summaryrefslogtreecommitdiff
path: root/src/include/c.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-05-26 23:48:54 +0000
committerBruce Momjian <bruce@momjian.us>2006-05-26 23:48:54 +0000
commit7a846ecc00b13a81adbf78b66dcf927077a802f8 (patch)
tree78124ecf7f8ca7922f1412ad8638eac46396f136 /src/include/c.h
parent4d63e267742a2afe481a34f4742c0551c6b0a112 (diff)
downloadpostgresql-7a846ecc00b13a81adbf78b66dcf927077a802f8.tar.gz
Use E'' strings internally only when standard_conforming_strings =
'off'. This allows pg_dump output with standard_conforming_strings = 'on' to generate proper strings that can be loaded into other databases without the backslash doubling we typically do. I have added the dumping of the standard_conforming_strings value to pg_dump. I also added standard backslash handling for plpgsql.
Diffstat (limited to 'src/include/c.h')
-rw-r--r--src/include/c.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 32082809ec..284367547e 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/c.h,v 1.200 2006/04/14 03:38:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.201 2006/05/26 23:48:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -472,7 +472,14 @@ typedef NameData *Name;
#define NameStr(name) ((name).data)
-#define SQL_STR_DOUBLE(ch) ((ch) == '\'' || (ch) == '\\')
+/*
+ * In 8.2, we are warning for \ in a non-E string if std_strings are off.
+ * For this reason, we use E for \ strings, unless standard_conforming_strings
+ * is on.
+ */
+#define SQL_STR_DOUBLE(ch, escape_backslash) \
+ ((ch) == '\'' || ((escape_backslash) && (ch) == '\\'))
+
#define ESCAPE_STRING_SYNTAX 'E'
/* ----------------------------------------------------------------