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/