Skip to content

Commit fe5f5ab

Browse files
committed
minor
1 parent bfc1d4e commit fe5f5ab

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

services/postgres/docker-entrypoint-initdb.d/create-readonly-user.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ schema=${SCHEMA:-public}
2323
echo "Creating read-only user: $readonly_user for $database.$schema ..."
2424
# NOTE: tabs only on <<
2525
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$database" <<-EOSQL
26-
CREATE USER $readonly_user WITH PASSWORD '$readonly_password';
27-
GRANT CONNECT ON DATABASE $database TO $readonly_user;
28-
GRANT USAGE ON SCHEMA $schema TO $readonly_user;
29-
GRANT SELECT ON ALL TABLES IN SCHEMA $schema TO $readonly_user;
30-
GRANT SELECT ON ALL SEQUENCES IN SCHEMA $schema TO $readonly_user;
31-
ALTER DEFAULT PRIVILEGES IN SCHEMA $schema GRANT SELECT ON TABLES TO $readonly_user;
26+
CREATE USER "$readonly_user" WITH PASSWORD '$readonly_password';
27+
GRANT CONNECT ON DATABASE $database TO "$readonly_user";
28+
GRANT USAGE ON SCHEMA $schema TO "$readonly_user";
29+
GRANT SELECT ON ALL TABLES IN SCHEMA $schema TO "$readonly_user";
30+
GRANT SELECT ON ALL SEQUENCES IN SCHEMA $schema TO "$readonly_user";
31+
ALTER DEFAULT PRIVILEGES IN SCHEMA $schema GRANT SELECT ON TABLES TO "$readonly_user";
3232
EOSQL

0 commit comments

Comments
 (0)