Re: pgsql: Minor pg_dump improvements - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Minor pg_dump improvements
Date
Msg-id 15960.1391966666@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Minor pg_dump improvements  (Stephen Frost <sfrost@snowman.net>)
Responses Re: pgsql: Minor pg_dump improvements  (Stephen Frost <sfrost@snowman.net>)
List pgsql-committers
Stephen Frost <sfrost@snowman.net> writes:
> Minor pg_dump improvements

I'm pretty sure you broke _CloseArchive with this hunk:

@@ -708,6 +708,9 @@ _CloseArchive(ArchiveHandle *AH)
    {
        WriteHead(AH);
        tpos = ftello(AH->FH);
+       if (tpos < 0 || errno)
+           exit_horribly(modulename, "could not determine seek position in archive file: %s\n",
+                         strerror(errno));
        WriteToc(AH);
        ctx->dataStart = _getFilePos(AH, ctx);

There's no reason to assume errno is zero at entry, and in any case
it should not be necessary to test for anything except tpos < 0.

I'm not sure why _ReopenArchive is coded like it was; seems like
tpos < 0 should be a sufficient test there too, and we shouldn't have to
reset errno beforehand.

            regards, tom lane


pgsql-committers by date:

Previous
From: Magnus Hagander
Date:
Subject: pgsql: Limit pg_basebackup progress output to 1/second
Next
From: Stephen Frost
Date:
Subject: Re: pgsql: Minor pg_dump improvements