pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Dmitry Koval <d.koval@postgrespro.ru>
Cc: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
Date: Wed, 24 Nov 2021 13:42:03 +0900
Message-ID: <YZ3Cm7PKGesAitYN@paquier.xyz> (raw)
In-Reply-To: <c97531c7-a439-78b5-33e6-6aab5a900949@postgrespro.ru>
References: <fe1cde9e-1e52-4f24-3ff7-d01f28a63790@postgrespro.ru>
	<YZdK6DjbtCT7rz9S@paquier.xyz>
	<4c22d38f-efa9-4d83-c551-707f1770e585@postgrespro.ru>
	<CAC+AXB1C1C_z3XQR=ZxiG+V0U9RDJFtJJamvYMoq+d4RoVRh4A@mail.gmail.com>
	<9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru>
	<CAC+AXB1FTZueNdvT1F4fpr4z9gxpcKkgWa-Awor9XC9PAKLVSA@mail.gmail.com>
	<YZiGIxk5F3TT/OJc@paquier.xyz>
	<ff540eb5-3493-cf02-6c22-20ef6e15fee9@postgrespro.ru>
	<CAC+AXB2GfM3NGjx7vc+=UvbD_bzQheiPqk2BQiFRn7G0oVUDhA@mail.gmail.com>
	<c97531c7-a439-78b5-33e6-6aab5a900949@postgrespro.ru>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (29+ messages)  latest in thread

Message-ID: <YZ3Cm7PKGesAitYN@paquier.xyz>
Permalink:  ../YZ3Cm7PKGesAitYN@paquier.xyz/
Also on:    postgresql.org/message-id/YZ3Cm7PKGesAitYN@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, d.koval@postgrespro.ru, juanjo.santamaria@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
  In-Reply-To: <YZ3Cm7PKGesAitYN@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox