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 YZ3Cm7PKGesAitYN@paquier.xyz
Whole thread Raw
In response to Re: BUG #17288: PSQL bug with COPY command (Windows)  (Dmitry Koval <d.koval@postgrespro.ru>)
Responses Re: BUG #17288: PSQL bug with COPY command (Windows)
List pgsql-bugs
On Mon, Nov 22, 2021 at 02:07:09PM +0300, Dmitry Koval wrote:
> > It reads a little too much like pseudocode for my liking. Please
> > consider the attached version.
>
> This is a good comment, I like it.

        /*
+        * Check if the fileno is a data stream. If so, unless it has been
+        * redirected to a file, getting information by handle will fail. Return
+        * the appropriate stat information instead.
+        */
I would perhaps add an extra note that we emulate the result in the
best way we can.  Anyway, what you have here looks basically enough.

Another thing that has been itching me on this thread is that we have
not been able to detect this problem even if we have tests in
copyselect.sql that cover those paths.  Is that because running
vcregress.pl implies a redirection of stdout so we would never see,
except from a terminal?
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: David Rowley
Date:
Subject: Re: BUG #17213: Wrong result from a query involving Merge Semi Join and Memoize
Next
From: Dmitry Koval
Date:
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)