init: grant permissions on public schema

Otherwise table creation fails with:
```
ERROR:  permission denied for schema public
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-08-29 15:44:57 +02:00
parent aa752f4062
commit f7720f0d5a
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 3 additions and 1 deletions

View File

@ -23,5 +23,7 @@ TEMPLATE "{{ db.template }}"
-- Permissions
{% for user in postgres_ha_users %}
GRANT {{ user.priv | default("pg_read_all_data") }} ON DATABASE {{ user.db | mandatory }} TO {{ user.name | mandatory }};
\connect "{{ user.db | mandatory }}";
GRANT {{ user.priv | default("pg_read_all_data") }} ON DATABASE "{{ user.db | mandatory }}" TO "{{ user.name | mandatory }}";
GRANT {{ user.priv | default("pg_read_all_data") }} ON SCHEMA public TO "{{ user.name | mandatory }}";
{% endfor %}