]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/create_postgresql_database.in
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / cats / create_postgresql_database.in
1 #!/bin/sh
2 #
3 # shell script to create Bacula database(s)
4 #
5
6 bindir=@SQL_BINDIR@
7
8 # use SQL_ASCII to be able to put any filename into
9 #  the database even those created with unusual character sets
10 ENCODING="ENCODING 'SQL_ASCII'"
11 # use UTF8 if you are using standard Unix/Linux LANG specifications
12 #  that use UTF8 -- this is normally the default and *should* be
13 #  your standard.  Bacula consoles work correctly *only* with UTF8.
14 #ENCODING="ENCODING 'UTF8'"
15      
16
17 if $bindir/psql -f - -d template1 $* <<END-OF-DATA
18 CREATE DATABASE bacula $ENCODING;
19 ALTER DATABASE bacula SET datestyle TO 'ISO, YMD';
20 END-OF-DATA
21 then
22    echo "Creation of bacula database succeeded."
23 else
24    echo "Creation of bacula database failed."
25 fi
26 exit 0