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

Commitb662e32

Browse files
committed
Forbid the switch combination --clean --create, which is pointless
(why bother dropping individual objects in a just-created database?)as well as dangerous (as the code stands, the drops will be issued inthe wrong database, namely the one you were originally connected to).
1 parent2628d9b commitb662e32

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
*$Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.33 2001/09/21 21:58:30 petere Exp $
18+
*$Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.34 2001/10/23 21:26:44 tgl Exp $
1919
*
2020
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
2121
*
@@ -162,9 +162,20 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
162162

163163
AH->ropt=ropt;
164164

165+
/*
166+
* Check for nonsensical option combinations.
167+
*
168+
* NB: create+dropSchema is useless because if you're creating the DB,
169+
* there's no need to drop individual items in it. Moreover, if we
170+
* tried to do that then we'd issue the drops in the database initially
171+
* connected to, not the one we will create, which is very bad...
172+
*/
165173
if (ropt->create&&ropt->noReconnect)
166174
die_horribly(AH,modulename,"-C and -R are incompatible options\n");
167175

176+
if (ropt->create&&ropt->dropSchema)
177+
die_horribly(AH,modulename,"-C and -c are incompatible options\n");
178+
168179
/*
169180
* If we're using a DB connection, then connect it.
170181
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp