Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ef151e

Browse files
committed
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 optionswas also given. Per report from Nick Johnson.
1 parent1cae920 commit3ef151e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.125 2006/02/14 23:30:43 tgl Exp $
18+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.126 2006/04/12 22:18:48 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -1908,17 +1908,18 @@ _tocEntryRequired(TocEntry *te, RestoreOptions *ropt, bool include_acls)
19081908
if (!ropt->create&&strcmp(te->desc,"DATABASE")==0)
19091909
return0;
19101910

1911-
/* Check if tablename only is wanted */
1911+
/* Check options for selective dump/restore */
1912+
if (ropt->schemaNames)
1913+
{
1914+
/* If no namespace is specified, it means all. */
1915+
if (!te->namespace)
1916+
return0;
1917+
if (strcmp(ropt->schemaNames,te->namespace)!=0)
1918+
return0;
1919+
}
1920+
19121921
if (ropt->selTypes)
19131922
{
1914-
if (ropt->schemaNames)
1915-
{
1916-
/* If no namespace is specified, it means all. */
1917-
if (!te->namespace)
1918-
return0;
1919-
if (strcmp(ropt->schemaNames,te->namespace)!=0)
1920-
return0;
1921-
}
19221923
if (strcmp(te->desc,"TABLE")==0||
19231924
strcmp(te->desc,"TABLE DATA")==0)
19241925
{

‎src/bin/pg_dump/pg_restore.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
*
3636
* IDENTIFICATION
37-
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.76 2006/02/1206:11:51 momjian Exp $
37+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.77 2006/04/1222:18:48 tgl Exp $
3838
*
3939
*-------------------------------------------------------------------------
4040
*/
@@ -188,7 +188,6 @@ main(int argc, char **argv)
188188
break;
189189

190190
case'n':/* Dump data for this schema only */
191-
opts->selTypes=1;
192191
opts->schemaNames=strdup(optarg);
193192
break;
194193

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp