]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/updatedb/update_postgresql_tables_9_to_10.in
Fix bug #2293 bad big endian detection in lz4.c
[bacula/bacula] / bacula / updatedb / update_postgresql_tables_9_to_10.in
index 97ecee2650bce3c55cffc0729fd966a21441b8a1..1cea36b74cf29b5798525fc95c6f2742fbdb301a 100644 (file)
@@ -1,5 +1,8 @@
 #!/bin/sh
 #
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
 # Shell script to update PostgreSQL tables from version 1.38 to 2.0.0 or higher
 #
 echo " "
@@ -8,11 +11,12 @@ echo " which is needed to convert from Bacula version 1.38.x to 2.0.0 or higher"
 echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 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 $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 ALTER TABLE media ADD COLUMN DeviceId integer;
 UPDATE media SET DeviceId=0;
 ALTER TABLE media ADD COLUMN MediaTypeId integer;