postgresql/src/bin
Tom Lane 1f996adab3 Fix pg_restore's direct-to-database mode for INSERT-style table data.
In commit 6545a901aa, I removed the mini SQL
lexer that was in pg_backup_db.c, thinking that it had no real purpose
beyond separating COPY data from SQL commands, which purpose had been
obsoleted by long-ago fixes in pg_dump's archive file format.
Unfortunately this was in error: that code was also used to identify
command boundaries in INSERT-style table data, which is run together as a
single string in the archive file for better compressibility.  As a result,
direct-to-database restores from archive files made with --inserts or
--column-inserts fail in our latest releases, as reported by Dick Visser.

To fix, restore the mini SQL lexer, but simplify it by adjusting the
calling logic so that it's only required to cope with INSERT-style table
data, not arbitrary SQL commands.  This allows us to not have to deal with
SQL comments, E'' strings, or dollar-quoted strings, none of which have
ever been emitted by dumpTableData_insert.

Also, fix the lexer to cope with standard-conforming strings, which was the
actual bug that the previous patch was meant to solve.

Back-patch to all supported branches.  The previous patch went back to 8.2,
which unfortunately means that the EOL release of 8.2 contains this bug,
but I don't think we're doing another 8.2 release just because of that.
2012-01-06 13:04:24 -05:00
..
initdb Translation updates 2011-12-01 22:59:40 +02:00
pg_config Translation updates 2011-12-01 22:59:40 +02:00
pg_controldata Translation updates 2011-12-01 22:59:40 +02:00
pg_ctl Translation updates 2011-12-01 22:59:40 +02:00
pg_dump Fix pg_restore's direct-to-database mode for INSERT-style table data. 2012-01-06 13:04:24 -05:00
pg_resetxlog Translation updates 2011-12-01 22:59:40 +02:00
pgevent Allow vpath builds and regression tests to succeed on Mingw. Backpatch to release 8.4 - earlier releases would require more changes and it's not worth the trouble. 2010-12-24 13:31:48 -05:00
psql Translation updates 2011-12-01 22:59:40 +02:00
scripts Translation updates 2011-12-01 22:59:40 +02:00
Makefile Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00