Re: psql exit status varies for scripts on STDIN

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jeffrey W(dot) Baker" <jwbaker(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: psql exit status varies for scripts on STDIN
Date: 2004-09-14 06:40:00
Message-ID: 200409140840.00022.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marcel Groner 2004-09-14 07:56:09 Re: postgresql hanging (blocking) with smp kernel
Previous Message Peter Eisentraut 2004-09-14 06:36:56 Re: Deadlock removal