aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_archiver.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2018-09-25 11:03:56 +0900
committerMichael Paquier <michael@paquier.xyz>2018-09-25 11:03:56 +0900
commit08c9917e24683e36dca35201723e47cdc3fa62db (patch)
treef9418d323eb12d5dfcbefd15f5de4379aeef17ab /src/bin/pg_dump/pg_backup_archiver.c
parentedb9797660541b217d23ae7c02b96b496d34fec4 (diff)
downloadpostgresql-08c9917e24683e36dca35201723e47cdc3fa62db.tar.gz
postgresql-08c9917e24683e36dca35201723e47cdc3fa62db.zip
Ignore publication tables when --no-publications is used
96e1cb4 has added support for --no-publications in pg_dump, pg_dumpall and pg_restore, but forgot the fact that publication tables also need to be ignored when this option is used. Author: Gilles Darold Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/3f48e812-b0fa-388e-2043-9a176bdee27e@dalibo.com Backpatch-through: 10, where publications have been added.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.c')
-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 7d1d439ba28..d1faa70d78d 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -2919,8 +2919,13 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
if (ropt->no_comments && strcmp(te->desc, "COMMENT") == 0)
return 0;
- /* If it's a publication, maybe ignore it */
- if (ropt->no_publications && strcmp(te->desc, "PUBLICATION") == 0)
+ /*
+ * If it's a publication or a table part of a publication, maybe ignore
+ * it.
+ */
+ if (ropt->no_publications &&
+ (strcmp(te->desc, "PUBLICATION") == 0 ||
+ strcmp(te->desc, "PUBLICATION TABLE") == 0))
return 0;
/* If it's a security label, maybe ignore it */