1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

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.
This commit is contained in:
Tom Lane
2006-04-12 22:18:48 +00:00
parent 1cae920e32
commit 3ef151e0b7
2 changed files with 12 additions and 12 deletions

View File

@ -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)
{