Fix pg_dump to do the right thing when escaping the contents of large objects.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 Aug 2009 21:56:09 +0000 (21:56 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 Aug 2009 21:56:09 +0000 (21:56 +0000)
commitd885cf42f21f72245651f46849c9b97c4601cd2f
treeed12af61f36cf3910ed64189e7d1cf82464378b0
parent04ec2b3eab44225529781b05d1a63696b7cc214e
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.
src/bin/pg_dump/dumputils.c
src/bin/pg_dump/dumputils.h
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_null.c