Re: pipe_read_line for reading arbitrary strings

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: pipe_read_line for reading arbitrary strings
Дата
Msg-id BAFF9C8F-0F7A-440F-AFBC-B0CECA8AB48D@yesql.se
обсуждение исходный текст
Ответ на Re: pipe_read_line for reading arbitrary strings  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
> On 6 Mar 2024, at 11:46, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> On 2024-Mar-06, Daniel Gustafsson wrote:
>
>> Good catch, that's an incorrect copy/paste, it should use ERRCODE_NO_DATA.  I'm
>> not convinced that a function to read from a pipe should consider not reading
>> anything successful by default, output is sort expected here.  We could add a
>> flag parameter to use for signalling that no data is fine though as per the
>> attached (as of yet untested) diff?
>
> I think adding dead code is not a great plan, particularly if it's hairy
> enough that we need to very carefully dissect what happens in error
> cases.  IMO if and when somebody has a need for an empty return string
> being acceptable, they can add it then.

I agree with that, there are no callers today and I can't imagine one off the
cuff.  The change to use the appropriate errcode still applies though.

--
Daniel Gustafsson




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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pipe_read_line for reading arbitrary strings
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Adding deprecation notices to pgcrypto documentation