Skip to content

Commit 614ce64

Browse files
committed
pg_restore: Error about incompatible options
This mirrors the equivalent error cases in pg_dump.
1 parent 3682025 commit 614ce64

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/bin/pg_dump/pg_restore.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,20 @@ main(int argc, char **argv)
314314
opts->useDB = 1;
315315
}
316316

317+
if (opts->dataOnly && opts->schemaOnly)
318+
{
319+
fprintf(stderr, _("%s: options -s/--schema-only and -a/--data-only cannot be used together\n"),
320+
progname);
321+
exit_nicely(1);
322+
}
323+
324+
if (opts->dataOnly && opts->dropSchema)
325+
{
326+
fprintf(stderr, _("%s: options -c/--clean and -a/--data-only cannot be used together\n"),
327+
progname);
328+
exit_nicely(1);
329+
}
330+
317331
/* Can't do single-txn mode with multiple connections */
318332
if (opts->single_txn && numWorkers > 1)
319333
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy