POSIX shell & Postgre Error capturing

@dragonbite

You need to add the option " -v ON_ERROR_STOP=1 " to your psql command
such that it reads


psql -v ON_ERROR_STOP=1 -d database_name -U user_name

then you will get an exit code 3 if one of the statements you pass to
psql fails, if you do not do that you will always get 0 as exit code
(unless the database connection itself fails then you get 2 or an 1 if
psql itself more or less completely crashes).


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.5 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10