I have been using or-sql with postgres backend for a long time.
There has been one annoyance that I finally fixed.
#+begin_src sql :engine postgresql :cmdline imdb
select * from abc
The error is not detected. I read the documentation of psql and the problem
seems to be that psql does not return an error code by default (even with invalid
This can be fixed two ways:
1. add to ~/.psqlrc
\set ON_ERROR_STOP on
2. By adding to the command, before it is executed by babel, this line. In
non-interactive mode psql will stop in the first error with an error code
and babel will catch it:
psql:/tmp/babel-51865ab/sql-in-5186Wyu:1: ERROR: relation "abc" does not exist
LINE 1: select * from abc
I am willing to implement #2, but the question is, is there a clean, easy way
to do this? Any hints on how to do it?
thank you very much,