Re: Allowing nonzero return codes from \quit

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allowing nonzero return codes from \quit
Date: 2017-01-23 21:12:38
Message-ID: 1364.1485205958@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
>> I didn't think about it too much, but I don't see why a user couldn't set
>> one of those error codes.
>> I did, however, think that any attempt to set an exit_code outside of
>> [0,127] would itself be an error, resulting in an exit code of 3.

> Hmmm. Maybe it should let the user shoots its own foot if desired, just a
> reminder in the doc of a possible interference with existing codes would
> be enough?

Yeah, I see no reason why scripts shouldn't be allowed to return one of
those codes if they like. We do need to constrain it to [0,127] for
sanity though, or possibly [0,125] --- doesn't POSIX mandate special
meaning for 126 and 127?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2017-01-23 21:31:42 Re: PoC: Grouped base relation
Previous Message Corey Huinker 2017-01-23 21:12:36 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)