diff db_schema/setup-db.sh @ 1313:b5ab25b7ac2c

Stop on error any execution of SQL via psql in DB setup. Though this duplicates respective \set commands in many scripts, I leave them there because they might help in debugging anyhow. Hopefully this change will improve prevention of adding broken SQL like currently audit.sql.
author Tom Gottfried <tom@intevation.de>
date Fri, 17 Mar 2017 12:52:23 +0100
parents ba47994c1665
children 46aa15c8cfb2
line wrap: on
line diff
--- a/db_schema/setup-db.sh	Wed Mar 08 15:59:47 2017 +0100
+++ b/db_schema/setup-db.sh	Fri Mar 17 12:52:23 2017 +0100
@@ -32,6 +32,9 @@
 DB_NAME=${3:-$ROLE_NAME}
 echo "DB_NAME = $DB_NAME"
 
+# Stop on error any execution of SQL via psql
+DB_CONNECT_STRING="-v ON_ERROR_STOP=on "
+
 # if variable DB_SRV and otional DB_PORT is set a remote database connection will be used
 if [ -n "$DB_SRV" ] ; then DB_CONNECT_STRING="-h $DB_SRV" ; fi
 if [ -n "$DB_SRV" -a -n "$DB_PORT"  ] ; then
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)