psql: immediately exit after an error?

Поиск
Список
Период
Сортировка
От David Garamond
Тема psql: immediately exit after an error?
Дата
Msg-id 41191285.7020600@zara.6.isreserved.com
обсуждение исходный текст
Ответы Re: psql: immediately exit after an error?  (Mike G <mike@thegodshalls.com>)
Re: psql: immediately exit after an error?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
Can psql be told to exit immediately after an error (especially when
doing commands from a file, -f)? This is the default behaviour of the
mysql client, except when we give it -f option ("force").

The problem is, when restoring a dump, a failure at the some point might
cause the subsequent commands to produce wrong results (e.g. I redefine
a builtin function with a plruby function with different behaviour, but
plruby failed to be installed due to wrong path. Thus the subsequent
commands are executed using the builtin function which is not the
expected one.) Furthermore, you can't check on psql exit code to see
whether _any_ command was not successfully executed.

Of course one should examine the full psql output after a restore
anyway, and the option to exit immediately after an error can save time
(especially for large dumps).

--
dave


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Relation does not exist
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: PostgreSQL 8.0.0 Officially Goes Beta