Re: [HACKERS] psql and libpq fixes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] psql and libpq fixes
Дата
Msg-id 2131.950027376@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] psql and libpq fixes  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: [HACKERS] psql and libpq fixes
Re: [HACKERS] psql and libpq fixes
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> This does bring up a thought --- should psql's kill-the-script-on-error
>> option perhaps zap the script only for errors committed outside of a
>> transaction block?

> Why is being in a transaction block important?

I was thinking that the script might be expecting an error, and have
established a begin-block to limit the effects of the error.

But on third thought, probably the thing that would be really useful
for "expected errors" is if there is a backslash-command that turns on
or off the kill-on-error behavior.  (The command line switch would
merely set the initial state of this flag.)  This way, a script could
use the option in an intelligent fashion:
\kill-on-error offDROP TABLE t1;\kill-on-error onCREATE TABLE t1;...

It'd still have to default to 'off' for backwards compatibility,
unfortunately, but something like this would be really useful.
        regards, tom lane


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

Предыдущее
От: Vince Vielhaber
Дата:
Сообщение: Re: [HACKERS] New Globe
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Ordering of pg_dump output