diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2013-07-02 20:07:35 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2013-07-02 20:07:35 -0400 |
commit | 614ce64f6c78a73861785e65d80deec8d280a5e9 (patch) | |
tree | 4a94ae5739a7a64903cfbe230f4186f9bf20248f | |
parent | 3682025015390a8e802e0752589162db7bd70b5d (diff) | |
download | postgresql-614ce64f6c78a73861785e65d80deec8d280a5e9.tar.gz postgresql-614ce64f6c78a73861785e65d80deec8d280a5e9.zip |
pg_restore: Error about incompatible options
This mirrors the equivalent error cases in pg_dump.
-rw-r--r-- | src/bin/pg_dump/pg_restore.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index c585098c72b..985c82621ba 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) { |