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