Re: Allowing nonzero return codes from \quit

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allowing nonzero return codes from \quit
Date: 2017-01-23 18:15:47
Message-ID: CAFj8pRAMvR5t7UaaL5kaasdf3_5bt5tr8bb0V2kNZu2DMW9-FA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2017-01-23 19:09 GMT+01:00 Corey Huinker <corey(dot)huinker(at)gmail(dot)com>:

> Another suggestion to come out of the \quit_if discussion was that someone
> might want to send a return code other than 0 back. Something like this:
>
> \quit 4
>
> or even:
>
>
> \set exit_code 127
> \quit :exit_code
>
> This isn't a personal need of mine, but I figured it was an idea worth
> discussing on its own.
>

\quit exit_code is better - if we define some special variable, then we
have to specify when it should be used and when not. Taking value from
command is clean without any another questions.

Regards

Pavel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2017-01-23 18:16:57 Re: Undefined psql variables
Previous Message Corey Huinker 2017-01-23 18:09:20 Allowing nonzero return codes from \quit