pgsql: Fix pg_restore to do the right thing when escaping large objects

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix pg_restore to do the right thing when escaping large objects
Date: 2011-01-21 21:23:01
Message-ID: E1PgORh-0003PC-Kz@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
REL8_3_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=1a1167a172ebc390437ffc5547a9f755fa56b731

Modified Files
--------------
src/bin/pg_dump/dumputils.c | 78 ++++++++++++++++++++++++++++++++++
src/bin/pg_dump/dumputils.h | 3 +
src/bin/pg_dump/pg_backup_archiver.c | 15 +++----
src/bin/pg_dump/pg_backup_archiver.h | 3 +
src/bin/pg_dump/pg_backup_null.c | 15 ++++---
5 files changed, 99 insertions(+), 15 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2011-01-21 21:48:40 pgsql: Correctly add exceptions to the plpy module for Python 3
Previous Message Robert Haas 2011-01-21 17:59:27 pgsql: Emphasize where OVER needs to be when using a window function.