psql exit code

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема psql exit code
Дата
Msg-id 20081110114308.766f79d5@dawn.webthatworks.it
обсуждение исходный текст
Ответы Re: psql exit code  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
I'm running:

ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username -f
script.sql
(or alternatively <script.sql)

echo $?
always returns 0 even when sql is clearly wrong.

If I do:
ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username -c
"selectz 1 from pippo;"

echo $?
returns 1

psql (PostgreSQL) 8.3.4

How can I know if something went wrong other than parsing the output?

Thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


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

Предыдущее
От: "Andrus"
Дата:
Сообщение: Re: How to use index in WHERE int = float
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: psql exit code