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

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
Дата
Msg-id alpine.DEB.2.20.1702012046410.31128@lancre
обсуждение исходный текст
Ответ на 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)  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
Hello,

> We could just issue interactive-only warnings when:
> - A user types a branching condition command which sets the branch inactive
> - A user types a command or query when the current branch is inactive.
>
> The warnings could be specific about state, something like:
>
> psql session is now in an inactive \if branch. No queries will be executed
> and only branching commands (\if, \elif, \else, \endif) will be evaluated.
> [...]

My 0.02€: it looks too verbose, should stay on one short line. Maybe:
  (in|)active (\if|\elif|\else), (execut|ignor)ing commands

Although there is some redundancy...
   calvin=>    \if true     active \if: executing commands   calvin=(t)> \echo ok     ok   calvin=(t)> \else
inactive\else: skipping commands   calvin=(f)> ...
 

Maybe it could be controlled, say based on VERBOSITY setting (which really 
controls verbosity of error reports) or some other.

I'm unsure whether it is a good idea, I like terse interfaces, but this is 
just an opinion.

-- 
Fabien.

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] WIP: [[Parallel] Shared] Hash
Следующее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: [HACKERS] logical decoding of two-phase transactions