diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-05-26 23:48:54 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-05-26 23:48:54 +0000 |
commit | 7a846ecc00b13a81adbf78b66dcf927077a802f8 (patch) | |
tree | 78124ecf7f8ca7922f1412ad8638eac46396f136 /src/bin/scripts | |
parent | 4d63e267742a2afe481a34f4742c0551c6b0a112 (diff) | |
download | postgresql-7a846ecc00b13a81adbf78b66dcf927077a802f8.tar.gz postgresql-7a846ecc00b13a81adbf78b66dcf927077a802f8.zip |
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/scripts')
-rw-r--r-- | src/bin/scripts/createdb.c | 4 | ||||
-rw-r--r-- | src/bin/scripts/createuser.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c index 54227de2b37..7413cdec52c 100644 --- a/src/bin/scripts/createdb.c +++ b/src/bin/scripts/createdb.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.16 2006/03/05 15:58:52 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.17 2006/05/26 23:48:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -184,7 +184,7 @@ main(int argc, char *argv[]) if (comment) { printfPQExpBuffer(&sql, "COMMENT ON DATABASE %s IS ", fmtId(dbname)); - appendStringLiteral(&sql, comment, false); + appendStringLiteral(&sql, comment, false, true); appendPQExpBuffer(&sql, ";\n"); conn = connectDatabase(dbname, host, port, username, password, progname); diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c index ce6700d8ef4..0d816b02e93 100644 --- a/src/bin/scripts/createuser.c +++ b/src/bin/scripts/createuser.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.27 2006/03/05 15:58:52 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.28 2006/05/26 23:48:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -258,11 +258,11 @@ main(int argc, char *argv[]) fprintf(stderr, _("Password encryption failed.\n")); exit(1); } - appendStringLiteral(&sql, encrypted_password, false); + appendStringLiteral(&sql, encrypted_password, false, true); PQfreemem(encrypted_password); } else - appendStringLiteral(&sql, newpassword, false); + appendStringLiteral(&sql, newpassword, false, true); } if (superuser == TRI_YES) appendPQExpBuffer(&sql, " SUPERUSER"); |