Re: psql return codes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql return codes
Date
Msg-id 184.1165433146@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql return codes  (Bruce Momjian <bruce@momjian.us>)
Responses Re: psql return codes  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.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.  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, but seeing
that -c can only issue a single command, implementing ON_ERROR_STOP
for it seems like largely a waste of effort.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: psql return codes
Next
From: Tom Lane
Date:
Subject: Re: Bug in PostGreSQL 8.2