Re: Add SHELL_EXIT_CODE to psql - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Add SHELL_EXIT_CODE to psql
Date
Msg-id CADkLM=eccA8yyLr8m1LP0sXvpdCrQqCH1YJ3bX50=cAhF6xi5A@mail.gmail.com
Whole thread Raw
In response to Re: Add SHELL_EXIT_CODE to psql  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Add SHELL_EXIT_CODE to psql
List 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 by date:

Previous
From: Nikita Malakhov
Date:
Subject: Re: run pgindent on a regular basis / scripted manner
Next
From: Andres Freund
Date:
Subject: Re: Non-superuser subscription owners