Re: BUG #17288: PSQL bug with COPY command (Windows)
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Dmitry Koval <d.koval@postgrespro.ru>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-11-20T05:22:43Z
Lists: 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
Commits
-
Fix compatibility thinko for fstat() on standard streams in win32stat.c
- 5550a9c38519 14.2 landed
- 58651d8dd6a5 15.0 landed
-
Fix fstat() emulation on Windows with standard streams
- d2198b4593cc 14.2 landed
- 10260c794b21 15.0 landed