Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-14 Thread Michael Paquier
On Tue, Mar 14, 2023 at 01:47:09PM +0100, Juan José Santamaría Flecha wrote: > I have just posted a patch to enforce the detection of unseekable streams > in the fseek() calls [1], please feel free to review it. Thanks. I have been able to get around 0001 to fix _pgfstat64() and applied it down

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-14 Thread Juan José Santamaría Flecha
Please, don't top post. On Tue, Mar 14, 2023 at 12:30 PM Daniel Watzinger < daniel.watzin...@gmail.com> wrote: > I'm sorry I couldn't contribute to the discussion in time. The fix of the > fstat() Win32 port looks good to me. I agree that there's a need for > multiple fseek() ports to address

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-14 Thread Daniel Watzinger
I'm sorry I couldn't contribute to the discussion in time. The fix of the fstat() Win32 port looks good to me. I agree that there's a need for multiple fseek() ports to address the shortcomings of the MSVC functionality. The documentation event states that "on devices incapable of seeking, the

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-13 Thread Michael Paquier
On Mon, Mar 13, 2023 at 05:49:41PM +0100, Juan José Santamaría Flecha wrote: > WFM, making fseek() behaviour more resilient seems like a good improvement > overall. I have not looked in details, but my guess would be to add a win32seek.c similar to win32stat.c with a port of fseek() that's more

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-13 Thread Juan José Santamaría Flecha
On Fri, Mar 10, 2023 at 2:37 AM Michael Paquier wrote: > 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

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-09 Thread Michael Paquier
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

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-09 Thread Juan José Santamaría Flecha
On Tue, Mar 7, 2023 at 1:36 PM Juan José Santamaría Flecha < juanjo.santama...@gmail.com> wrote: > > On Thu, Mar 2, 2023 at 8:01 AM Michael Paquier > wrote: > >> >> The internal implementation of _pgstat64() is used in quite a few >> > places, so we'd better update this part first, IMO, and then

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-07 Thread Juan José Santamaría Flecha
On Thu, Mar 2, 2023 at 8:01 AM Michael Paquier wrote: > > We had better make sure that this does not break again 10260c7, and > these could not be reproduced with automated tests as they needed a > Windows terminal. Isn't this issue like the other commit, where the > automated testing cannot

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2023-03-01 Thread Michael Paquier
On Sat, Dec 17, 2022 at 12:55:24AM +0100, Daniel Watzinger wrote: > Well, this is embarassing. Sorry for the inconvenience. Some part > of my company's network infrastruture must have mangled the attachment. > Both mails were sent using a combination of git format-patch > and git send-email.

pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2022-12-18 Thread Daniel Watzinger
Well, this is embarassing. Sorry for the inconvenience. Some part of my company's network infrastruture must have mangled the attachment. Both mails were sent using a combination of git format-patch and git send-email. However, as this is my first foray into this email-based workflow, I won't

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2022-12-16 Thread Daniel Gustafsson
> On 16 Dec 2022, at 16:09, Daniel Watzinger wrote: > first-time contributor here. I certainly hope I got the patch > creation and email workflow right. Let me know if anything can be > improved as I`m eager to learn. Welcome! The patch seems to be in binary format or using some form of

pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2022-12-16 Thread Daniel Watzinger
Hi there, first-time contributor here. I certainly hope I got the patch creation and email workflow right. Let me know if anything can be improved as I`m eager to learn. Regression tests (check) were successful on native Win32 MSVC as well as Debian. Here comes the patch and corresponding