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 77fe51a3a53..eed28b2af89 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -529,9 +529,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