Re: BUG #17288: PSQL bug with COPY command (Windows)

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
Date: 2021-11-18 11:37:08
Message-ID: CAC+AXB02qGeNP_hNK8mio9GPFbeAAESjVJciLNs6gQo-ykEc_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for reporting.

On Thu, Nov 18, 2021 at 8:40 AM Michael Paquier <michael(at)paquier(dot)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 Content-Type Size
v2-0001-Fixed-Windows-stat-emulation-working-with-streams.patch application/octet-stream 659 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry Koval 2021-11-18 13:23:54 Re: BUG #17288: PSQL bug with COPY command (Windows)
Previous Message Giacomo Colonesi 2021-11-18 11:17:06 Re: BUG #17289: Postgres 14.1 Windows installer fails with unknown error and terminates