diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-21 16:22:35 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-21 16:22:35 -0500 |
commit | aae2a02c9d04bf8fc7469cb2097a6ef44e273bc9 (patch) | |
tree | 5007c34e78485ffe2e02132aea0ef4f1d8f39323 /src/bin/pg_dump/dumputils.h | |
parent | 2a0abe10f3899d5b802f9df6a7ceffc72f513f16 (diff) |
Fix pg_restore to do the right thing when escaping large objects.
Specifically, this makes the workflow pg_dump -Fc -> pg_restore -> file
produce correct output for BLOBs when the source database has
standard_conforming_strings turned on. It was already okay when that was
off, or if pg_restore was told to restore directly into a database.
This is a back-port of commit b1732111f233bbb72788e92a627242ec28a85631 of
2009-08-04, with additional changes to emit old-style escaped bytea data
instead of hex-style. At the time, we had not heard of anyone encountering
the problem in the field, so I judged it not worth the risk of changing
back branches. Now we do have a report, from Bosco Rama, so back-patch
into 8.2 through 8.4. 9.0 and up are okay already.
Diffstat (limited to 'src/bin/pg_dump/dumputils.h')
-rw-r--r-- | src/bin/pg_dump/dumputils.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h index 94beade2137..9e3686e1ddc 100644 --- a/src/bin/pg_dump/dumputils.h +++ b/src/bin/pg_dump/dumputils.h @@ -26,6 +26,9 @@ extern void appendStringLiteralConn(PQExpBuffer buf, const char *str, PGconn *conn); extern void appendStringLiteralDQ(PQExpBuffer buf, const char *str, const char *dqprefix); +extern void appendByteaLiteral(PQExpBuffer buf, + const unsigned char *str, size_t length, + bool std_strings); extern int parse_version(const char *versionString); extern bool parsePGArray(const char *atext, char ***itemarray, int *nitems); extern bool buildACLCommands(const char *name, const char *type, |