1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-16 17:07:43 +03:00

pg_dump: Add --no-publications option

Author: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
Peter Eisentraut
2017-05-12 09:15:40 -04:00
parent b807f59828
commit 96e1cb4c0f
8 changed files with 49 additions and 1 deletions

View File

@@ -166,6 +166,7 @@ dumpOptionsFromRestoreOptions(RestoreOptions *ropt)
dopt->disable_dollar_quoting = ropt->disable_dollar_quoting;
dopt->dump_inserts = ropt->dump_inserts;
dopt->no_publications = ropt->no_publications;
dopt->no_security_labels = ropt->no_security_labels;
dopt->no_subscriptions = ropt->no_subscriptions;
dopt->lockWaitTimeout = ropt->lockWaitTimeout;
@@ -2792,6 +2793,10 @@ _tocEntryRequired(TocEntry *te, teSection curSection, RestoreOptions *ropt)
if (ropt->aclsSkip && _tocEntryIsACL(te))
return 0;
/* If it's a publication, maybe ignore it */
if (ropt->no_publications && strcmp(te->desc, "PUBLICATION") == 0)
return 0;
/* If it's security labels, maybe ignore it */
if (ropt->no_security_labels && strcmp(te->desc, "SECURITY LABEL") == 0)
return 0;