Re: psql exit status varies for scripts on STDIN - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: psql exit status varies for scripts on STDIN
Date
Msg-id 200409140840.00022.peter_e@gmx.net
Whole thread Raw
In response to Re: psql exit status varies for scripts on STDIN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> If -c is considered to be a shorthand for a script, then this ought
> to yield either 0 or 3 depending on whether ON_ERROR_STOP is set by
> ~/.psqlrc.  However I'm not sure if ~/.psqlrc is read for a -c
> invocation.  I'd be willing to agree that -c should act as though
> ON_ERROR_STOP is set always ... but in that case the exit code should
> be 3, not 1.

-c isn't really like a script, it's just a one-shot command.  (You can't
mix SQL and meta-commands, for example.)  I think changing the exit
status from 1 to 3 is reasonable.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Deadlock removal
Next
From: Richard Huxton
Date:
Subject: Re: Best practices for migrating a development database