aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 7f7a0f1ce7b..ba5e6acbbb8 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -538,9 +538,14 @@ RestoreArchive(Archive *AHX)
*/
if (*te->dropStmt != '\0')
{
- if (!ropt->if_exists)
+ if (!ropt->if_exists ||
+ strncmp(te->dropStmt, "--", 2) == 0)
{
- /* No --if-exists? Then just use the original */
+ /*
+ * Without --if-exists, or if it's just a comment (as
+ * happens for the public schema), print the dropStmt
+ * as-is.
+ */
ahprintf(AH, "%s", te->dropStmt);
}
else