Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)

Поиск
Список
Период
Сортировка
От Corey Huinker
Тема Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
Дата
Msg-id CADkLM=cxEPJW+67cnam_on_fH3eQaekTS-8=Aa-JM+4ETr71Kw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)  (Corey Huinker <corey.huinker@gmail.com>)
Ответы Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
On Sat, Feb 4, 2017 at 11:53 AM, Corey Huinker <corey.huinker@gmail.com> wrote:
The check I was suggesting on whether Ctrl+C has been pressed
on an empty line seems harder to implement, because get_interactive()
just calls readline() or fgets(), which block to return when a whole
line is ready. AFAICS psql can't know what was the edit-in-progress
when these functions are interrupted by a signal instead of
returning normally.
But I don't think this check is essential, it could be left to another patch.

Glad I wasn't missing something obvious.
I suppose we could base the behavior on whether there's at least one full line already buffered.
However, I agree that it can be left to another patch.

v6 patch. highlights:
- error messages are now a bit more terse, following suggestions
- help text is more terse and Conditionals section was moved below Input Output
- leverage IFSTATE_NONE a bit to fold some not-in-a-branch cases into existing switch statements, giving flatter, slightly cleaner code and that addresses expected cases before exceptional ones
- comments highlight which messages are printed in both interactive and script mode.
- put Fabien's tap test in place verbatim
- No mention of Ctrl-C or PROMPT. Those can be addressed in separate patches.

There's probably some more consensus building to do over the interactive messages and comments, and if interactive-ish tests are possible with TAP, we should add those too.

Вложения

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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: [HACKERS] Logical Replication and Character encoding
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: [HACKERS] Review: GIN non-intrusive vacuum of posting tree