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

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry Koval 2021-11-24 07:44:09 Re: BUG #17288: PSQL bug with COPY command (Windows)
Previous Message David Rowley 2021-11-24 01:58:30 Re: BUG #17213: Wrong result from a query involving Merge Semi Join and Memoize