Re: Add SHELL_EXIT_CODE to psql
От | Corey Huinker |
---|---|
Тема | Re: Add SHELL_EXIT_CODE to psql |
Дата | |
Msg-id | CADkLM=eccA8yyLr8m1LP0sXvpdCrQqCH1YJ3bX50=cAhF6xi5A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Add SHELL_EXIT_CODE to psql (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: Add SHELL_EXIT_CODE to psql
|
Список | pgsql-hackers |
On Fri, Jan 20, 2023 at 8:54 AM Robert Haas <robertmhaas@gmail.com> wrote:
On Wed, Jan 4, 2023 at 2:09 AM Corey Huinker <corey.huinker@gmail.com> wrote:
> 2. There are now two psql variables, SHELL_EXIT_CODE, which has the return code, and SHELL_ERROR, which is a true/false flag based on whether the exit code was nonzero. These variables are the shell result analogues of SQLSTATE and ERROR.
Seems redundant.
SHELL_ERROR is helpful in that it is a ready-made boolean that works for \if tests in the same way that ERROR is set to true any time SQLSTATE is nonzero. We don't yet have inline expressions for \if so the ready-made boolean is a convenience.
Or are you suggesting that I should have just set ERROR itself rather than create SHELL_ERROR?
В списке pgsql-hackers по дате отправления: