aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_archiver.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-06-09 17:56:51 +0000
committerBruce Momjian <bruce@momjian.us>2005-06-09 17:56:51 +0000
commitebc8649892d02a9c6991e00d3e273670ca46fe56 (patch)
tree051b445e5864d14fb44d16fed629cdc5d0688a1e /src/bin/pg_dump/pg_backup_archiver.c
parent4d0e7b4aace5cdad7137d6efe71bcad4015c2518 (diff)
downloadpostgresql-ebc8649892d02a9c6991e00d3e273670ca46fe56.tar.gz
postgresql-ebc8649892d02a9c6991e00d3e273670ca46fe56.zip
Since I needed this feature badly, I added the -n / --schema switch to
pg_restore. It restores the given schemaname only. It can be used in conjunction with the -t and other switches to make the selection very fine grained. Richard van den Bergg, CISSP
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.c')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index be12cc4e592..8afe0fc8c54 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.109 2005/05/17 17:30:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.110 2005/06/09 17:56:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1997,6 +1997,14 @@ _tocEntryRequired(TocEntry *te, RestoreOptions *ropt, bool include_acls)
/* Check if tablename only is wanted */
if (ropt->selTypes)
{
+ if (ropt->schemaNames)
+ {
+ /* If no namespace is specified, it means all. */
+ if (!te->namespace)
+ return 0;
+ if(strcmp(ropt->schemaNames, te->namespace) != 0)
+ return 0;
+ }
if ((strcmp(te->desc, "TABLE") == 0) || (strcmp(te->desc, "TABLE DATA") == 0))
{
if (!ropt->selTable)