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=fdBs+G1QrUvqu5MxW7jGg-ULZFcM3Fd2kev6fjrp7-0g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless) (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless) |
Список | pgsql-hackers |
I think ParseVariableBool is only likely to change to reject a NULL value
rather than silently interpreting it as FALSE, which is the way it is in
HEAD right now. That behavior is a leftover hack, really, and moving the
treatment of unset values upstream seems a lot cleaner. See my draft
patch at
https://www.postgresql.org/message-id/30629.1485881533@ sss.pgh.pa.us
regards, tom lane
Updated patch:
- rebased on post-psql hooks master
- took nearly every suggestion for change to documentation
- \if ERROR will throw the entire \if..\endif into IGNORE mode
- state is now pushed on all \ifs
- reinstated leveraging of ParseVariableBool
- history is now kept in interactive mode regardless of \if-truth
- reworked coding example to cause less agita
- removed MainLoop "are endifs balanced" variable in favor of in-place check which respects ON_ERROR_STOP.
- make changes to psql/Makefile to enable TAP tests and created t/ directory
- wrote an intentionally failing TAP test to see if "make check" executes it. it does not. need help.
I'm hoping my failure in that last bit is easy to spot/fix, so I can move forward with testing unbalanced branching, etc.
Вложения
В списке pgsql-hackers по дате отправления: