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

Поиск
Список
Период
Сортировка
От Juan José Santamaría Flecha
Тема Re: BUG #17288: PSQL bug with COPY command (Windows)
Дата
Msg-id CAC+AXB1FTZueNdvT1F4fpr4z9gxpcKkgWa-Awor9XC9PAKLVSA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17288: PSQL bug with COPY command (Windows)  (Dmitry Koval <d.koval@postgrespro.ru>)
Ответы Re: BUG #17288: PSQL bug with COPY command (Windows)  (Dmitry Koval <d.koval@postgrespro.ru>)
Re: BUG #17288: PSQL bug with COPY command (Windows)  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-bugs

On Fri, Nov 19, 2021 at 11:45 AM Dmitry Koval <d.koval@postgrespro.ru> wrote:
 >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...

Personally, I think it is more readable, although a comment should explain what we are checking.

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.

Regards,

Juan José Santamaría Flecha

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Dmitry Koval
Дата:
Сообщение: Re: BUG #17288: PSQL bug with COPY command (Windows)
Следующее
От: Dmitry Koval
Дата:
Сообщение: Re: BUG #17288: PSQL bug with COPY command (Windows)