-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
environmentdeployment, testing and other devops stuffdeployment, testing and other devops stuff
Description
During deploys we can see warning in the logs:
err: WARNING: database "toby-prod" has a collation version mismatch
err: DETAIL: The database was created using collation version 2.31, but the operating system provides version 2.36.
err: HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE "toby-prod" REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
Prod:
Beta:
This happen probably after upgrade PostgreSQL database to the newer version. (It's doing automatically, because we have set image: postgres:15 in docker compose).
Possible solution:
- Backup
- Run manually on database server
REINDEX DATABASE <database name>;
ALTER DATABASE <database name> REFRESH COLLATION VERSION;
https://www.postgresql.org/docs/current/sql-altercollation.html#SQL-ALTERCOLLATION-NOTES
Additional steps:
We should lock postgreSQL version to prevent "silent updates"
- https://github.com/blumilksoftware/toby/blob/main/docker-compose.yml#L44
- https://github.com/blumilksoftware/toby/blob/main/environment/prod/deployment/beta/docker-compose.beta.yml#L49
- https://github.com/blumilksoftware/toby/blob/main/environment/prod/deployment/prod/docker-compose.prod.yml#L53
Actually used version: 15.5-1.pgdg120+1 (for this moment)
Also we should consider to use pg_upgrade tool during switching major versions.
https://www.postgresql.org/docs/15/pgupgrade.html
Metadata
Metadata
Assignees
Labels
environmentdeployment, testing and other devops stuffdeployment, testing and other devops stuff