Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deployment with PostgreSQL 15 #75

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

smortex
Copy link
Member

@smortex smortex commented Jun 20, 2024

We previously did not change the database owner for PostgreSQL,
resulting in the database being owned by the postgres user.

PostgreSQL 15 revoked the CREATE permission from all users except a
database owner from the public schema. As a consequence, migration that
are expected to create objects are not allowed to do so with this
version and newer of PostgreSQL.

Explicitly make the database user the owner of it, to allow migrations.

Also include:

We previously did not change the database owner for PostgreSQL,
resulting in the database being owned by the `postgres` user.

PostgreSQL 15 revoked the CREATE permission from all users except a
database owner from the public schema.  As a consequence, migration that
are expected to create objects are not allowed to do so with this
version and newer of PostgreSQL.

Explicitly make the database user the owner of it, to allow migrations.
@smortex smortex requested a review from a team as a code owner June 20, 2024 20:07
@smortex
Copy link
Member Author

smortex commented Jun 20, 2024

@opus-codium/core I am not sure if we should consider this a bug (we fix something that is broken into something that is working), or a breaking-change (we will change the database owner of older databases that do not care about this). Thoughts?

@smortex smortex added the bug Something isn't working label Jun 29, 2024
@smortex
Copy link
Member Author

smortex commented Jun 29, 2024

@opus-codium/core I am not sure if we should consider this a bug (we fix something that is broken into something that is working), or a breaking-change (we will change the database owner of older databases that do not care about this). Thoughts?

I made my mind: this previously worked because older version of PostgreSQL allowed any user to create objects in the public schema of a database. This was realistically a bug that was fixed upstream, and due to the fact that we did not set a proper owner on the database, it beats us today.

@neomilium
Copy link
Member

@opus-codium/core I am not sure if we should consider this a bug (we fix something that is broken into something that is working), or a breaking-change (we will change the database owner of older databases that do not care about this). Thoughts?

Its a fix to me: we manage whole application and its a side effect of postgresql upgrade, not due to our module.

@neomilium neomilium merged commit 012b0c3 into main Jul 2, 2024
8 checks passed
@neomilium neomilium deleted the fix-deployment-with-postgresql-15 branch July 2, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants