pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Koval <d.koval@postgrespro.ru>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
Date: Fri, 19 Nov 2021 13:45:10 +0300
Message-ID: <9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru> (raw)
In-Reply-To: <CAC+AXB1C1C_z3XQR=ZxiG+V0U9RDJFtJJamvYMoq+d4RoVRh4A@mail.gmail.com>
References: <17288-6b58a91025a8a8a3@postgresql.org>
	<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>

 >We can check for redirection without calling
 >GetFileInformationByHandle(), please consider the attached patch.

There are doubts:

1) we always use system function (GetFinalPathNameByHandleA or
GetFileInformationByHandle); sometimes we use these two calls
GetFinalPathNameByHandleA + GetFileInformationByHandle
together (in freopen() case);

2) function GetFinalPathNameByHandleA is slower than
GetFileInformationByHandle (2-4 times).
Might be exist a cheaper way than GetFinalPathNameByHandleA?

I don't understand why this way better than using one call
GetFileInformationByHandle...

With best regards,
Dmitry Koval.





view thread (29+ messages)  latest in thread

Message-ID: <9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru>
Permalink:  ../9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru/
Also on:    postgresql.org/message-id/9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru

 · 

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: d.koval@postgrespro.ru, juanjo.santamaria@gmail.com, michael@paquier.xyz
  Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
  In-Reply-To: <9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru>
  References: <17288-6b58a91025a8a8a3@postgresql.org> <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>

* 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