James Sewell <james(dot)sewell(at)lisasoft(dot)com> writes:
> My question is in a rollback scenario is it possible to get PSQL to return
> a non 0 exit status?
Maybe you could use -c instead of -f?
$ psql -c 'select 1; select 1/0' regression
ERROR: division by zero
$ echo $?
1
You won't need explicit BEGIN/END because this is already a single
transaction.
regards, tom lane