pg_dump et al: Add --if-exists option
This option makes pg_dump, pg_dumpall and pg_restore inject an IF EXISTS clause to each DROP command they emit. (In pg_dumpall, the clause is not added to individual objects drops, but rather to the CREATE DATABASE commands, as well as CREATE ROLE and CREATE TABLESPACE.) This allows for a better user dump experience when using --clean in case some objects do not already exist. Per bug #7873 by Dave Rolsky. Author: Pavel Stěhule Reviewed-by: Jeevan Chalke, Álvaro Herrera, Josh Kupershmidt
Showing
- doc/src/sgml/ref/pg_dump.sgml 13 additions, 1 deletiondoc/src/sgml/ref/pg_dump.sgml
- doc/src/sgml/ref/pg_dumpall.sgml 11 additions, 0 deletionsdoc/src/sgml/ref/pg_dumpall.sgml
- doc/src/sgml/ref/pg_restore.sgml 13 additions, 1 deletiondoc/src/sgml/ref/pg_restore.sgml
- src/bin/pg_dump/pg_backup.h 1 addition, 0 deletionssrc/bin/pg_dump/pg_backup.h
- src/bin/pg_dump/pg_backup_archiver.c 71 additions, 2 deletionssrc/bin/pg_dump/pg_backup_archiver.c
- src/bin/pg_dump/pg_dump.c 7 additions, 0 deletionssrc/bin/pg_dump/pg_dump.c
- src/bin/pg_dump/pg_dumpall.c 19 additions, 3 deletionssrc/bin/pg_dump/pg_dumpall.c
- src/bin/pg_dump/pg_restore.c 11 additions, 0 deletionssrc/bin/pg_dump/pg_restore.c
Loading
Please register or sign in to comment