Re: BUG #17288: PSQL bug with COPY command (Windows) - Mailing list pgsql-bugs

From Juan José Santamaría Flecha
Subject Re: BUG #17288: PSQL bug with COPY command (Windows)
Date
Msg-id CAC+AXB02qGeNP_hNK8mio9GPFbeAAESjVJciLNs6gQo-ykEc_w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17288: PSQL bug with COPY command (Windows)  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #17288: PSQL bug with COPY command (Windows)
List pgsql-bugs
Thanks for reporting.

On Thu, Nov 18, 2021 at 8:40 AM Michael Paquier <michael@paquier.xyz> wrote:
On Wed, Nov 17, 2021 at 01:29:02PM +0300, Dmitry Koval wrote:
> Attachments: patch + screenshot with error.

I think that we had better never call GetFileInformationByHandle() if
we use a fileno that maps to stdin, stdout or stderr.  The 10000$
question is what to use though.  One option is to let our emulation
code fill in the gap for those three cases with at least st_mode
filled with S_IFIFO, then return 0 as error code :/

When the file descriptor is coming from a stream I don't think we have to use GetFileInformationByHandle() or stat() to get any information, but we can directly return the stat information. Please find attached a patch for so.

Regards,

Juan José Santamaría Flecha
Attachment

pgsql-bugs by date:

Previous
From: Giacomo Colonesi
Date:
Subject: Re: BUG #17289: Postgres 14.1 Windows installer fails with iso-8859-1 error and terminates
Next
From: Dmitry Koval
Date:
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)