diff options
author | Cullum Smith <cullum@sacredheartsc.com> | 2024-10-25 00:49:42 -0400 |
---|---|---|
committer | Cullum Smith <cullum@sacredheartsc.com> | 2024-10-25 00:49:42 -0400 |
commit | 7bb5176a0e1d3a7d8a119b92758404d514f59be9 (patch) | |
tree | 216cc2c9b1af8ddd337d619bc8c77e44bba94b1a /lib/60-postgres | |
parent | e2fc0433de38c322ce46ad250bc0f0f03e7710c8 (diff) | |
download | infrastructure-7bb5176a0e1d3a7d8a119b92758404d514f59be9.tar.gz |
icinga stuff
Diffstat (limited to 'lib/60-postgres')
-rw-r--r-- | lib/60-postgres | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/60-postgres b/lib/60-postgres index af37c27..6f418ea 100644 --- a/lib/60-postgres +++ b/lib/60-postgres @@ -17,8 +17,8 @@ EOF } postgres_create_database(){ - # $1 = postgres_host, $2 = dbname, $3 = owner + # $1 = postgres_host, $2 = dbname, $3 = owner $4 = encoding, $5 = locale cat <<EOF | postgres_run -h "${1}" -d postgres -SELECT 'CREATE DATABASE "${2}" OWNER "${3:-postgres}"' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '${2}')\\gexec +SELECT 'CREATE DATABASE "${2}" ENCODING "${4:-UTF8}" LOCALE "${5:-en_US.UTF-8}" OWNER "${3:-postgres}" TEMPLATE "template0"' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '${2}')\\gexec EOF } |