git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3682025)
pg_restore: Error about incompatible options
Wed, 3 Jul 2013 00:07:35 +0000 (20:07 -0400)
Wed, 3 Jul 2013 00:07:35 +0000 (20:07 -0400)
This mirrors the equivalent error cases in pg_dump.


diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index c585098c72b5f8b9c120bdee79a019e33981782c..985c82621ba5a66cc0bdc936af927e044d6e66fc 100644 (file)
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -314,6 +314,20 @@ main(int argc, char **argv)
opts->useDB = 1;
}
+ if (opts->dataOnly && opts->schemaOnly)
+ {
+ fprintf(stderr, _("%s: options -s/--schema-only and -a/--data-only cannot be used together\n"),
+ progname);
+ exit_nicely(1);
+ }
+
+ if (opts->dataOnly && opts->dropSchema)
+ {
+ fprintf(stderr, _("%s: options -c/--clean and -a/--data-only cannot be used together\n"),
+ progname);
+ exit_nicely(1);
+ }
+
/* Can't do single-txn mode with multiple connections */
if (opts->single_txn && numWorkers > 1)
{
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /