Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)
От | Fabien COELHO |
---|---|
Тема | Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless) |
Дата | |
Msg-id | alpine.DEB.2.20.1702260807540.10344@lancre обсуждение исходный текст |
Ответ на | Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless) (Corey Huinker <corey.huinker@gmail.com>) |
Ответы |
Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)
|
Список | pgsql-hackers |
Hello Corey, About v18: Patch applies, make check ok, psql tap tests ok. ISTM that contrary to the documentation "\elif something" is not evaluated in all cases, and the resulting code is harder to understand with a nested switch and condition structure: switch default read if switch I wish (this is a personal taste) it could avoid switch-nesting on the very same value. It should also conform to the documentation. If there is no compelling reason for the switch-nesting, I would suggest to move the read_boolean_expression before the swich, to deal with error immediately there, and then to have just one switch. Alternatively if the structure must really be kept, then deal with errors in a first switch, read value *after* switch and deal with other errors there, then start a second switch, and adjust the documentation accordingly? switch errors read if errors // no error switch Also, the %R documentation has single line marker '^' before not executed '@', but it is the reverse in the code. -- Fabien.
В списке pgsql-hackers по дате отправления: