summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_archiver.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-04-12 22:18:48 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-04-12 22:18:48 +0000
commit3ef151e0b779c1ac99d8d4acf05ed4db742504ba (patch)
tree064d0c66dc0eb63d9f5f217cebd210c7d2a5e238 /src/bin/pg_dump/pg_backup_archiver.c
parent1cae920e3209e4f5b1464aaef0c8bee59c53c946 (diff)
downloadpostgresql-3ef151e0b779c1ac99d8d4acf05ed4db742504ba.tar.gz
Fix pg_restore -n option to do what the man page says it does. The
original coding only worked if one of the selTypes restriction options was also given. Per report from Nick Johnson.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.c')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 7b883967a3..e9fea7e3a7 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.125 2006/02/14 23:30:43 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.126 2006/04/12 22:18:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1908,17 +1908,18 @@ _tocEntryRequired(TocEntry *te, RestoreOptions *ropt, bool include_acls)
if (!ropt->create && strcmp(te->desc, "DATABASE") == 0)
return 0;
- /* Check if tablename only is wanted */
+ /* Check options for selective dump/restore */
+ 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 (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)
{