Re: BUG #16688: psql removes only LF without CR at end of backquotes on windows.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16688: psql removes only LF without CR at end of backquotes on windows.
Дата
Msg-id 1224124.1603855625@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16688: psql removes only LF without CR at end of backquotes on windows.  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #16688: psql removes only LF without CR at end of backquotes on windows.  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> psql removes only LF without CR at end of backquotes on windows.

Hmm, seems like b654714f9 missed this.  psqlscanslash.l has

    fd = popen(cmd, PG_BINARY_R);
    ...
        /* strip any trailing newline */
        if (cmd_output.len > 0 &&
            cmd_output.data[cmd_output.len - 1] == '\n')
            cmd_output.len--;

But rather than mess with that newline-chomping code, I'm
inclined to wonder why we're using PG_BINARY_R for input
that we clearly expect to be textual.  Most of our other
popen's do not do that.

Bruce, this seems to date to 98e9775a3 ... don't suppose
you remember that?  I see the point about control-Z in text
files, but I wonder how plausible that is for popen cases.

            regards, tom lane



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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Non-Materialized CTE bug?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #16688: psql removes only LF without CR at end of backquotes on windows.