pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Dmitry Koval <d.koval@postgrespro.ru>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
Date: Sat, 20 Nov 2021 14:22:43 +0900
Message-ID: <YZiGIxk5F3TT/OJc@paquier.xyz> (raw)
In-Reply-To: <CAC+AXB1FTZueNdvT1F4fpr4z9gxpcKkgWa-Awor9XC9PAKLVSA@mail.gmail.com>
References: <b95273fb-a51a-d0a9-e4a8-501e32e204e5@postgrespro.ru>
	<YZYDZwDtw/Ioojb4@paquier.xyz>
	<9e4efe29-0ff9-0808-fe32-d1d50e0be4fa@postgrespro.ru>
	<CAC+AXB3BKByL8O39qARu3XYMWmrNqMWhcHZZ_2ygqvrK-W6O1g@mail.gmail.com>
	<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>

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

Attachments:

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

view thread (29+ messages)  latest in thread

Message-ID: <YZiGIxk5F3TT/OJc@paquier.xyz>
Permalink:  ../YZiGIxk5F3TT%2FOJc@paquier.xyz/
Also on:    postgresql.org/message-id/YZiGIxk5F3TT/OJc@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, juanjo.santamaria@gmail.com, d.koval@postgrespro.ru
  Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
  In-Reply-To: <YZiGIxk5F3TT/OJc@paquier.xyz>
  References: <b95273fb-a51a-d0a9-e4a8-501e32e204e5@postgrespro.ru> <YZYDZwDtw/Ioojb4@paquier.xyz> <9e4efe29-0ff9-0808-fe32-d1d50e0be4fa@postgrespro.ru> <CAC+AXB3BKByL8O39qARu3XYMWmrNqMWhcHZZ_2ygqvrK-W6O1g@mail.gmail.com> <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>

* 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