pgsql: Fix bugs in "restore.sql" script emitted in pg_dump tar output. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix bugs in "restore.sql" script emitted in pg_dump tar output.
Date
Msg-id E1TI52V-0001GD-Pc@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix bugs in "restore.sql" script emitted in pg_dump tar output.

The tar output module did some very ugly and ultimately incorrect hacking
on COPY commands to try to get them to work in the context of restoring a
deconstructed tar archive.  In particular, it would fail altogether for
table names containing any upper-case characters, since it smashed the
command string to lower-case before modifying it (and, just to add insult
to injury, did that in a way that would fail in multibyte encodings).
I don't see any particular value in being flexible about the case of the
command keywords, since the string will just have been created by
dumpTableData, so let's get rid of the whole case-folding thing.

Also, it doesn't seem to meet the POLA for the script to restore data only
in COPY mode, so add \i commands to make it have comparable behavior in
--inserts mode.

Noted while looking at the tar-output code in connection with Brian
Weaver's patch.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/fab2ae0ec9e71227003ae1177ef8c633a80ae4b0

Modified Files
--------------
src/bin/pg_dump/pg_backup_tar.c |   82 ++++++++++++++++----------------------
1 files changed, 35 insertions(+), 47 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix bugs in "restore.sql" script emitted in pg_dump tar output.
Next
From: Tom Lane
Date:
Subject: pgsql: Fix bugs in "restore.sql" script emitted in pg_dump tar output.