Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32 - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32
Date
Msg-id ZAqJ38jFIm5LBpYI@paquier.xyz
Whole thread Raw
In response to Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Responses Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
List pgsql-hackers
On Fri, Mar 10, 2023 at 12:12:37AM +0100, Juan José Santamaría Flecha wrote:
> I've broken the patch in two:
> 1. fixes the detection of unseekable files in checkSeek(), using logic that
> hopefully is backpatchable,
> 2. the improvements on file type detection for stat() proposed by the OP.

I am OK with 0002, so I'll try to get this part backpatched down to
where the implementation of stat() has been added.  I am not
completely sure that 0001 is the right way forward, though,
particularly with the long-term picture..  In the backend, we have one
caller of fseeko() as of read_binary_file(), so we would never pass
down a pipe to that.  However, there could be a risk of some silent
breakages on Windows if some new code relies on that?

There is a total of 11 callers of fseeko() in pg_dump, so rather than
relying on checkSeek() to see if it actually works, I'd like to think
that we should have a central policy to make this code more
bullet-proof in the future.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add pg_walinspect function with block info columns
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Align GSS and TLS error handling in PQconnectPoll()