Re: psql return codes

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: psql return codes
Дата
Msg-id 1165434534.3839.421.camel@silverbirch.site
обсуждение исходный текст
Ответ на Re: psql return codes  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: psql return codes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, 2006-12-06 at 14:25 -0500, Tom Lane wrote:
> 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. 

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




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: old synchronized scan patch
Следующее
От: "Simon Riggs"
Дата:
Сообщение: Re: old synchronized scan patch