aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_custom.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-28 21:48:58 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-28 21:48:58 -0400
commitd6e7abe45a64378113c1c717a831b7aac9c451df (patch)
tree938bf59d42ae83817df3c82d9bbbb865f73691dd /src/bin/pg_dump/pg_backup_custom.c
parent2c5d6f1fb570db1a287532d3291d284710e756bf (diff)
downloadpostgresql-d6e7abe45a64378113c1c717a831b7aac9c451df.tar.gz
postgresql-d6e7abe45a64378113c1c717a831b7aac9c451df.zip
Be more user-friendly about unsupported cases for parallel pg_restore.
If we are unable to do a parallel restore because the input file is stdin or is otherwise unseekable, we should complain and fail immediately, not after having done some of the restore. Complaining once per thread isn't so cool either, and the messages should be worded to make it clear this is an unsupported case not some weird race-condition bug. Per complaint from Lonni Friedman. Back-patch to 8.4, where parallel restore was introduced.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_custom.c')
-rw-r--r--src/bin/pg_dump/pg_backup_custom.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 01d5e379999..9224d7bbe2e 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -735,10 +735,15 @@ _ReopenArchive(ArchiveHandle *AH)
if (AH->mode == archModeWrite)
die_horribly(AH, modulename, "can only reopen input archives\n");
+
+ /*
+ * These two cases are user-facing errors since they represent unsupported
+ * (but not invalid) use-cases. Word the error messages appropriately.
+ */
if (AH->fSpec == NULL || strcmp(AH->fSpec, "") == 0)
- die_horribly(AH, modulename, "cannot reopen stdin\n");
+ die_horribly(AH, modulename, "parallel restore from stdin is not supported\n");
if (!ctx->hasSeek)
- die_horribly(AH, modulename, "cannot reopen non-seekable file\n");
+ die_horribly(AH, modulename, "parallel restore from non-seekable file is not supported\n");
errno = 0;
tpos = ftello(AH->FH);