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

From Michael Paquier
Subject Re: BUG #17288: PSQL bug with COPY command (Windows)
Date
Msg-id YZiGIxk5F3TT/OJc@paquier.xyz
Whole thread Raw
In response to Re: BUG #17288: PSQL bug with COPY command (Windows)  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Responses Re: BUG #17288: PSQL bug with COPY command (Windows)
List pgsql-bugs
On Fri, Nov 19, 2021 at 12:44:14PM +0100, Juan José Santamaría Flecha wrote:
> GetFinalPathNameByHandleA() is slower when there is redirection, when there
> is no redirection it's similar or faster than GetFileInformationByHandle(),
> and that should be the most common case.

Yeah, the slight performance impact caused by the redirection does not
worry me much, based on the code path of Postgres where this would be
called.  And that's unlikely going to become a bottleneck anyway as
GetFinalPathNameByHandleA() would just be called if we know that we
are with stdin, stdout or stderr thanks to the first part of the "if"
clause.

I like the simplicity behind v4 as it does not interfere with
_pgstat64() while dealing with the redirection case, so it should
address the concerns from Dmitry anyway (right?).  We should really
add a comment explaining why this is handled this way though for the
case of streams, why the case of the redirection matters, and why we
count on a failure of GetFinalPathNameByHandleA().
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: conchuela timeouts since 2021-10-09 system upgrade
Next
From: PG Bug reporting form
Date:
Subject: BUG #17294: spgist doesn't support varchar, only text type fields.