diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2016-09-20 12:00:00 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2016-09-20 12:00:00 -0400 |
commit | 46b55e7f853dc0ef60ae3b1042b883fa4ffac95f (patch) | |
tree | 3b0dc6a4221e701d08bfcdfc951adb1d8826558f /src/bin/pg_dump/pg_backup_archiver.c | |
parent | 16d1adb35cf887325b7c5dbf473632d557065171 (diff) | |
download | postgresql-46b55e7f853dc0ef60ae3b1042b883fa4ffac95f.tar.gz postgresql-46b55e7f853dc0ef60ae3b1042b883fa4ffac95f.zip |
pg_restore: Add -N option to exclude schemas
This is similar to the -N option in pg_dump, except that it doesn't take
a pattern, just like the existing -n option in pg_restore.
From: Michael Banck <michael.banck@credativ.de>
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 05bdbdbf02a..a69b06f6d76 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -2751,6 +2751,11 @@ _tocEntryRequired(TocEntry *te, teSection curSection, RestoreOptions *ropt) return 0; } + if (ropt->schemaExcludeNames.head != NULL + && te->namespace + && simple_string_list_member(&ropt->schemaExcludeNames, te->namespace)) + return 0; + if (ropt->selTypes) { if (strcmp(te->desc, "TABLE") == 0 || |