Commit 665b0657 authored by Jo's avatar Jo
Browse files

fix(pg-create): decouple create and grant

parent eb2cc26c
#!/bin/bash
set +x
set -e
set +e
#
# create a new user and DB on a remote Azure Postgres server
......@@ -44,6 +44,10 @@ echo "creating user ${NEW_USER_BASE} on ${PGHOST}"
psql -abe "$PG_URL_ADMIN" -c "
SET timezone TO 'Europe/Paris';
CREATE USER \"$NEW_USER_BASE\" WITH PASSWORD '$NEW_PASSWORD';
"
echo "grant user ${NEW_USER_BASE} on ${PGHOST}"
psql -abe "$PG_URL_ADMIN" -c "
GRANT \"$NEW_USER_BASE\" to \"${PGUSER%%@*}\";
GRANT ALL PRIVILEGES ON DATABASE \"$NEW_DB_NAME\" TO \"$NEW_USER_BASE\";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment