bindir=@SQL_BINDIR@
PATH="$bindir:$PATH"
-db_name=${db_name:-@db_name@}
-db_user=${db_user:-@db_user@}
+db_name=@db_name@
# use SQL_ASCII to be able to put any filename into
# the database even those created with unusual character sets
#
#ENCODING="ENCODING 'UTF8'"
-if createdb -u${db_user} $* ${db_name}
+if createdb $* ${db_name}
then
echo "Creation of ${db_name} database succeeded."
else
#
bindir=@SQL_BINDIR@
-PATH="$bindir:$PATH"
-db_name=${db_name:-@db_name@}
-db_user=${db_user:-@db_user@}
+db_name=@db_name@
-if destroydb -u${db_user} ${db_name}
+if destroydb ${db_name}
then
echo "Drop of ${db_name} database succeeded."
else
# shell script to delete Bacula tables for PostgreSQL
bindir=@SQL_BINDIR@
-PATH="$bindir:$PATH"
-db_name=${db_name:-@db_name@}
-db_user=${db_user:-@db_user@}
+db_name=@db_name@
sql -u${db_user} ${db_name} $* <<END-OF-DATA
DROP TABLE filename\g
# shell script TO GRANT privileges to the bacula database
#
bindir=@SQL_BINDIR@
-PATH="$bindir:$PATH"
db_name=${db_name:-@db_name@}
db_user=${db_user:-@db_user@}
\g
END-OF-DATA
-if sql -u${db_user} ${db_name} $* <<END-OF-DATA
+if sql ${db_name} $* <<END-OF-DATA
-- for tables
GRANT ALL ON TABLE filename TO ${db_user};
bindir=@SQL_BINDIR@
PATH="$bindir:$PATH"
db_name=${db_name:-@db_name@}
-db_user=${db_user:-@db_user@}
-sql -u${db_user} $* ${db_name} <<END-OF-DATA
+sql $* ${db_name} <<END-OF-DATA
SET AUTOCOMMIT ON\g