Commit abac4d8b authored by Michał 'rysiek' Woźniak's avatar Michał 'rysiek' Woźniak
Browse files

better handling of role existing already in create_readonly_postgres_user

parent 83190899
......@@ -311,7 +311,7 @@ function create_readonly_postgres_user() {
# make sure the role exists
PGPASSWORD="$PG_PASS" psql -h "$PG_HOST" -U "$PG_USER" -c "
CREATE ROLE $RUSER_NAME NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN NOREPLICATION PASSWORD '$RUSER_PW';" postgres \
|| { display_error "Error creating the $RUSER_NAME role."; return 1; }
|| { display_error "Error creating the $RUSER_NAME role."; read -P "Hit Enter to continue or Ctrl-C to abort" ; }
# make sure the role has the basic required privileges (and lacks the unneeded ones)
PGPASSWORD="$PG_PASS" psql -h "$PG_HOST" -U "$PG_USER" -c "GRANT SELECT ON pg_authid TO $RUSER_NAME;" postgres \
......
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