]> granicus.if.org Git - postgresql/commit
Fix pg_dump's handling of DROP DATABASE commands in --clean mode.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Oct 2012 20:58:32 +0000 (16:58 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Oct 2012 20:58:42 +0000 (16:58 -0400)
commita4ef1f09bd870048ed91b43c5b584cf90cc59b54
treebf20e030aa08522a47e536c49adf13ddd4b95040
parent12b721a7f0e3cb05630f267e0d9b4e63bbba6b0b
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.
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/ref/pg_restore.sgml
src/bin/pg_dump/pg_backup_archiver.c