Fix script so that it works in current postgres container.

This commit is contained in:
Jens Peter Secher 2017-12-04 10:10:51 +01:00
parent aced58e35f
commit dfc6df914b

View File

@ -10,10 +10,10 @@ function create_user_and_database() {
CREATE USER $database;
CREATE DATABASE $database;
GRANT ALL PRIVILEGES ON DATABASE $database TO $database;
EOSQL
EOSQL
}
if [ $POSTGRES_MULTIPLE_DATABASES ]; then
if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
create_user_and_database $db