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

From Stephen Frost
Subject Re: pgsql: Minor pg_dump improvements
Date
Msg-id 20140209175413.GZ2921@tamriel.snowman.net
Whole thread Raw
In response to Re: pgsql: Minor pg_dump improvements  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Minor pg_dump improvements  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> > Minor pg_dump improvements
>
> I'm pretty sure you broke _CloseArchive with this hunk:

That'd be pretty frustrating as my testing didn't exhibit any issues.

> @@ -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.

Good point.

> 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.

Agreed, I'll update that also.

    Thanks,

        Stephen

Attachment

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Minor pg_dump improvements
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Minor pg_dump improvements