]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/create_postgresql_database.in
ebl Modify disk-changer to check if slot contains something before
[bacula/bacula] / bacula / src / cats / create_postgresql_database.in
index 1cbe61e9e6a4f9de938f9707a7c3f61b1b1b8930..0debbc67efb6aa4dc1264fd6a25bbff85307b694 100644 (file)
@@ -4,13 +4,30 @@
 #
 
 bindir=@SQL_BINDIR@
+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 'SQL_ASCII'"
+# use UTF8 if you are using standard Unix/Linux LANG specifications
+#  that use UTF8 -- this is normally the default and *should* be
+#  your standard.  Bacula works correctly *only* with correct UTF8.
+#
+#  Note, with this encoding, if you have any "weird" filenames on
+#  your system (names generated from Win32 or Mac OS), you may
+#  get Bacula batch insert failures.
+#
+#ENCODING="ENCODING 'UTF8'"
+     
 
 if $bindir/psql -f - -d template1 $* <<END-OF-DATA
-CREATE DATABASE bacula;
+CREATE DATABASE ${db_name} $ENCODING;
+ALTER DATABASE ${db_name} SET datestyle TO 'ISO, YMD';
 END-OF-DATA
 then
-   echo "Creation of bacula database succeeded."
+   echo "Creation of ${db_name} database succeeded."
 else
-   echo "Creation of bacula database failed."
+   echo "Creation of ${db_name} database failed."
 fi
 exit 0