On Fri, Jan 20, 2023 at 8:54 AM Robert Haas <robertmh...@gmail.com> wrote:

> On Wed, Jan 4, 2023 at 2:09 AM Corey Huinker <corey.huin...@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?

Reply via email to