summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 93814152a5f..59eaecb4ed7 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -3081,6 +3081,21 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
if (ropt->no_security_labels && strcmp(te->desc, "SECURITY LABEL") == 0)
return 0;
+ /*
+ * If it's a security label on a publication or a subscription, maybe
+ * ignore it.
+ */
+ if (strcmp(te->desc, "SECURITY LABEL") == 0)
+ {
+ if (ropt->no_publications &&
+ strncmp(te->tag, "PUBLICATION", strlen("PUBLICATION")) == 0)
+ return 0;
+
+ if (ropt->no_subscriptions &&
+ strncmp(te->tag, "SUBSCRIPTION", strlen("SUBSCRIPTION")) == 0)
+ return 0;
+ }
+
/* If it's a subscription, maybe ignore it */
if (ropt->no_subscriptions && strcmp(te->desc, "SUBSCRIPTION") == 0)
return 0;