pgsql: Fix pg_dump's handling of DROP DATABASE commands in --clean mode - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix pg_dump's handling of DROP DATABASE commands in --clean mode
Date
Msg-id E1TPg8n-0007HT-O7@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix pg_dump's handling of DROP DATABASE commands in --clean mode.

In commit 4317e0246c645f60c39e6572644cff1cb03b4c65, I accidentally broke
this behavior while rearranging code to ensure that --create wouldn't
affect whether a DATABASE entry gets put into archive-format output.
Thus, 9.2 would issue a DROP DATABASE command in --clean mode, which is
either useless or dangerous depending on the usage scenario.
It should not do that, and no longer does.

A bright spot is that this refactoring makes it easy to allow the
combination of --clean and --create to work sensibly, ie, emit DROP
DATABASE then CREATE DATABASE before reconnecting.  Ordinarily we'd
consider that a feature addition and not back-patch it, but it seems
silly to not include the extra couple of lines required in the 9.2
version of the code.

Per report from Guillaume Lelarge, though this is slightly more extensive
than his proposed patch.

Branch
------
REL9_2_STABLE

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

Modified Files
--------------
doc/src/sgml/ref/pg_dump.sgml        |    9 ++++++---
doc/src/sgml/ref/pg_restore.sgml     |   17 ++++++++++++-----
src/bin/pg_dump/pg_backup_archiver.c |   32 +++++++++++++++++++-------------
3 files changed, 37 insertions(+), 21 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Prevent overflow in pgbench's percent-done display.
Next
From: Kevin Grittner
Date:
Subject: pgsql: Correct predicate locking for DROP INDEX CONCURRENTLY.