From: Peter Eisentraut Date: Wed, 3 Jul 2013 00:07:35 +0000 (-0400) Subject: pg_restore: Error about incompatible options X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=614ce64f6c78a73861785e65d80deec8d280a5e9;p=users%2Fbernd%2Fpostgres.git pg_restore: Error about incompatible options 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 c585098c72..985c82621b 100644 --- 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) {