]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/updatedb/update_postgresql_tables_10_to_11.in
Try to fix bug #2349 multiple recycle messages
[bacula/bacula] / bacula / updatedb / update_postgresql_tables_10_to_11.in
index 87381c29f26cc4cd42466460b1c7f05c5b61134c..8a30dbbbb5a42127c8cb9dc5f139bd0d573e3fe8 100644 (file)
@@ -1,16 +1,19 @@
 #!/bin/sh
 #
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
 # Shell script to update PostgreSQL tables from version 2.0.0 to 3.0.0 or higher
 #
 echo " "
 echo "This script will update a Bacula PostgreSQL database from version 10 to 11"
 echo " which is needed to convert from Bacula version 2.0.0 to 3.0.x or higher"
 echo " "
-bindir=@SQL_BINDIR@
-db_name=@db_name@
-
-if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
+bindir=@POSTGRESQL_BINDIR@
+PATH="$bindir:$PATH"
+db_name=${db_name:-@db_name@}
 
+if psql -f - -d ${db_name} $* <<END-OF-DATA
 -- The alter table operation can be faster with a big maintenance_work_mem
 -- Uncomment and adapt this value to your environment
 -- SET maintenance_work_mem = '1GB';