Commit 45683ef
committed
RMB-1052: ERROR: 42501: permission denied for "CREATE SCHEMA IF NOT EXISTS"
https://folio-org.atlassian.net/browse/RMB-1052
As a sysop I need to remove the CREATE privilege for the database from the postgres role an RMB based module uses (principle of least privileges).
The CREATE privilege for the database is not needed after the tenant-module schema has been created.
However, when upgrading a tenant to a new module version RMB executes `CREATE SCHEMA IF NOT EXISTS` that fails if the privilege has been removed,
even if the schema exists:
```
ERROR: 42501: permission denied for database postgres
```
Fix: Skip that `CREATE SCHEMA` statement if the schema already exists.1 parent a670973 commit 45683ef
1 file changed
Lines changed: 8 additions & 1 deletion
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
0 commit comments