pgsql: Fix pg_dump to do the right thing when escaping the contents of

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix pg_dump to do the right thing when escaping the contents of
Date: 2009-08-04 21:56:09
Message-ID: 20090804215609.1BC7675331E@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix pg_dump to do the right thing when escaping the contents of large objects.

The previous implementation got it right in most cases but failed in one:
if you pg_dump into an archive with standard_conforming_strings enabled, then
pg_restore to a script file (not directly to a database), the script will set
standard_conforming_strings = on but then emit large object data as
nonstandardly-escaped strings.

At the moment the code is made to emit hex-format bytea strings when dumping
to a script file. We might want to change to old-style escaping for backwards
compatibility, but that would be slower and bulkier. If we do, it's just a
matter of reimplementing appendByteaLiteral().

This has been broken for a long time, but given the lack of field complaints
I'm not going to worry about back-patching.

Modified Files:
--------------
pgsql/src/bin/pg_dump:
dumputils.c (r1.47 -> r1.48)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/dumputils.c?r1=1.47&r2=1.48)
dumputils.h (r1.24 -> r1.25)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/dumputils.h?r1=1.24&r2=1.25)
pg_backup_archiver.c (r1.173 -> r1.174)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_backup_archiver.c?r1=1.173&r2=1.174)
pg_backup_archiver.h (r1.80 -> r1.81)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_backup_archiver.h?r1=1.80&r2=1.81)
pg_backup_null.c (r1.21 -> r1.22)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_backup_null.c?r1=1.21&r2=1.22)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2009-08-04 22:04:37 pgsql: Use DocBook XSL stylesheets for man page building This switches
Previous Message Alvaro Herrera 2009-08-04 21:22:46 pgsql: Avoid including miscadmin.h into plpgsql.h; instead include it