diff options
| author | Bruce Momjian | 2006-05-26 23:48:54 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2006-05-26 23:48:54 +0000 |
| commit | 7a846ecc00b13a81adbf78b66dcf927077a802f8 (patch) | |
| tree | 78124ecf7f8ca7922f1412ad8638eac46396f136 /src/bin/initdb | |
| parent | 4d63e267742a2afe481a34f4742c0551c6b0a112 (diff) | |
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/bin/initdb')
| -rw-r--r-- | src/bin/initdb/initdb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index b6ed4bfa679..e32c4cf3a99 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -42,7 +42,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * Portions taken from FreeBSD. * - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.114 2006/03/21 17:54:28 alvherre Exp $ + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.115 2006/05/26 23:48:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2103,7 +2103,8 @@ check_ok(void) } /* - * Escape any single quotes or backslashes in given string + * Escape any single quotes or backslashes in given string; + * postgresql.conf always enables backslash escapes */ static char * escape_quotes(const char *src) @@ -2115,7 +2116,7 @@ escape_quotes(const char *src) for (i = 0, j = 0; i < len; i++) { - if (SQL_STR_DOUBLE(src[i])) + if (SQL_STR_DOUBLE(src[i], true)) result[j++] = src[i]; result[j++] = src[i]; } |
