3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # This routine alters the appropriately configured
7 # Bacula tables for PostgreSQL, Ingres, MySQL, or SQLite.
10 # can be used to change the current user with su
13 default_db_type=@DEFAULT_DB_TYPE@
16 # See if the first argument is a valid backend name.
17 # If so the user overrides the default database backend.
39 # If no new db_type is gives use the default db_type.
41 if [ -z "${db_type}" ]; then
42 db_type="${default_db_type}"
45 if [ $db_type = postgresql -a "$UID" = 0 ]; then
46 pre_command="su - postgres -c"
49 echo "Altering ${db_type} tables"
50 $pre_command "@scriptdir@/update_${db_type}_tables $*"