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

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
This commit is contained in:
Bruce Momjian
2005-06-09 17:56:51 +00:00
parent 4d0e7b4aac
commit ebc8649892
4 changed files with 33 additions and 5 deletions

View File

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