From: | "Simon Riggs" <simon(at)2ndquadrant(dot)com> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "Bruce Momjian" <bruce(at)momjian(dot)us>, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: psql return codes |
Date: | 2006-12-06 19:48:53 |
Message-ID: | 1165434534.3839.421.camel@silverbirch.site |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, 2006-12-06 at 14:25 -0500, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Jim C. Nasby wrote:
> >> Why should it matter if the "SELECT * FROM foo" came to
> >> psql via -f or -c?
>
> > Well, it explains exactly what Simon was seeing. I agree it is strange,
> > but I was asking if Simon knew it was documented.
Yes, but it doesn't say what a "script" is and doesn't explain either.
> I assume the "3" is
> > used to report a different error from 'file not found' or something.
>
> Well, the real point here is that ON_ERROR_STOP doesn't apply to
> interactive input, and -c is evidently being considered to be
> interactive. You could argue that either way I suppose
I'm all ears...
> , but seeing
> that -c can only issue a single command, implementing ON_ERROR_STOP
> for it seems like largely a waste of effort.
The main point is that rc=1 doesn't always mean the same thing, which
makes it harder to write scripts that handle errors correctly.
It may be a small thing, but that doesn't make it right.
--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2006-12-06 19:55:48 | Re: old synchronized scan patch |
Previous Message | Jeff Davis | 2006-12-06 19:46:48 | Re: old synchronized scan patch |