Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Doing it only for interactive mode seems too error-prone to me (it works
> in psql, but not from my script).
You're missing the point: a script cannot safely work this way. A human
typing at the terminal can notice that his command failed and react to
that, but a psql script cannot.
regards, tom lane