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

Commit3a819b0

Browse files
committed
Throw an error when using -C and -1 at the same time in pg_restore.
It's not possible to do CREATE DATABASE inside a transaction, so previouslywe just got a server error instead.Backpatch to 8.2, which is where the -1 feature appeared.
1 parent6458022 commit3a819b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 7 additions & 1 deletion
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.160 2009/01/05 16:54:36 tgl Exp $
18+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.161 2009/01/13 11:44:56 mha Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -146,6 +146,12 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
146146
*/
147147
if (ropt->create&&ropt->dropSchema)
148148
die_horribly(AH,modulename,"-C and -c are incompatible options\n");
149+
/*
150+
* -1 is not compatible with -C, because we can't create a database
151+
* inside a transaction block.
152+
*/
153+
if (ropt->create&&ropt->single_txn)
154+
die_horribly(AH,modulename,"-C and -1 are incompatible options\n");
149155

150156
/*
151157
* If we're using a DB connection, then connect it.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp