Skip to content

RMB-1052: 42501: permission denied "CREATE SCHEMA IF NOT EXISTS"#1230

Merged
julianladisch merged 2 commits into
masterfrom
RMB-1052
Apr 9, 2026
Merged

RMB-1052: 42501: permission denied "CREATE SCHEMA IF NOT EXISTS"#1230
julianladisch merged 2 commits into
masterfrom
RMB-1052

Conversation

@julianladisch

Copy link
Copy Markdown
Contributor

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.

…XISTS"

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.
@sonarqubecloud

sonarqubecloud Bot commented Apr 9, 2026

Copy link
Copy Markdown

@julianladisch julianladisch merged commit 3c202f5 into master Apr 9, 2026
16 checks passed
@julianladisch julianladisch deleted the RMB-1052 branch April 9, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant