if (AH->version < K_VERS_1_8)
die_horribly(AH, modulename, "parallel restore is not supported with archives made by pre-8.0 pg_dump\n");
+ /*
+ * It's also not gonna work if we can't reopen the input file, so let's
+ * try that immediately.
+ */
+ (AH->ReopenPtr) (AH);
+
slots = (ParallelSlot *) calloc(sizeof(ParallelSlot), n_slots);
/* Adjust dependency information */
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);