Re: [PERFORM] psql -A (unaligned format) eats too much

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PERFORM] psql -A (unaligned format) eats too much
Дата
Msg-id 17223.1149605250@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PERFORM] psql -A (unaligned format) eats too much  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
"Jim C. Nasby" <jnasby@pervasive.com> writes:
> On Tue, Jun 06, 2006 at 09:48:43AM -0400, Tom Lane wrote:
>>> psql --cursor -c "select ..." | myprogram
>>> there would be no very good way for myprogram to find out that it'd
>>> been sent an incomplete result due to error partway through the SELECT.

> So if an error occurs partway through reading a cursor, no error message
> is generated? That certainly sounds like a bug to me...

Sure an error is generated.  But it goes to stderr.  The guy at the
downstream end of the stdout pipe cannot see either the error message,
or the nonzero status that psql will (hopefully) exit with.

You can theoretically deal with this by having the shell script calling
this combination check psql exit status and discard the results of
myprogram on failure, but it's not easy or simple.
        regards, tom lane


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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: [PERFORM] psql -A (unaligned format) eats too much
Следующее
От: Harald Fuchs
Дата:
Сообщение: Re: COPY (query) TO file