From: Michael Narigon Date: Mon, 4 Feb 2019 12:00:52 +0000 (+0100) Subject: Change create_postgresql_database.in script to be more flexible X-Git-Tag: Release-9.4.2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf9648ea0780bc782a58bd8f455140c80d421ada;p=thirdparty%2Fbacula.git Change create_postgresql_database.in script to be more flexible --- diff --git a/bacula/src/cats/create_postgresql_database.in b/bacula/src/cats/create_postgresql_database.in index deff1017c..d2a685648 100644 --- a/bacula/src/cats/create_postgresql_database.in +++ b/bacula/src/cats/create_postgresql_database.in @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2000-2017 Kern Sibbald +# Copyright (C) 2000-2019 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # shell script to create Bacula database(s) @@ -18,14 +18,13 @@ PSQLVERSION=`psql -d template1 -c 'select version()' $* | awk '/PostgreSQL/ {pri # # Note, LC_COLLATE and LC_TYPE are needed on 8.4 and beyond, but are # not implemented in 8.3 or below. -# This must be updated for future versions of PostgreSQL # case ${PSQLVERSION} in - 8.[456789] | 9.* | 10.*) - ENCODING="ENCODING 'SQL_ASCII' LC_COLLATE 'C' LC_CTYPE 'C'" + 6.* | 7.* | 8.[0123]) + ENCODING="ENCODING 'SQL_ASCII'" ;; *) - ENCODING="ENCODING 'SQL_ASCII'" + ENCODING="ENCODING 'SQL_ASCII' LC_COLLATE 'C' LC_CTYPE 'C'" ;; esac @@ -53,7 +52,7 @@ else echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit 1 fi -if psql -l | grep " ${db_name}.*SQL_ASCII" >/dev/null; then +if psql -l $* | grep " ${db_name}.*SQL_ASCII" >/dev/null; then echo "Database encoding OK" else echo " "