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

create_readonly_postgres_user: now more robust against certain weird outputs from psql

parent 9dd85de5
......@@ -315,7 +315,7 @@ function create_readonly_postgres_user() {
|| { display_error "Error creating the $RUSER_NAME role and granting SELECT on pg_authid."; return 1; }
# get the list of roles
ROLES="$( PGPASSWORD="$PG_PASS" psql -h "$PG_HOST" -U "$PG_USER" -Aqt -c '\dg' postgres | grep '|' | cut -d '|' -f 1 )" \
ROLES="$( PGPASSWORD="$PG_PASS" psql -h "$PG_HOST" -U "$PG_USER" -qt -c '\dg' postgres | grep '|' | cut -d '|' -f 1 | tr -d ' ' | egrep -v '^$' )" \
|| { display_error "Error getting list of roles"; return 2; }
# and for each role
......
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