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.
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).
REINDEX DATABASE <database name>;
ALTER DATABASE <database name> REFRESH COLLATION VERSION;
During deploys we can see warning in the logs:
Prod:
Beta:
This happen probably after upgrade PostgreSQL database to the newer version. (It's doing automatically, because we have set
image: postgres:15in docker compose).Possible solution:
https://www.postgresql.org/docs/current/sql-altercollation.html#SQL-ALTERCOLLATION-NOTES
Additional steps:
We should lock postgreSQL version to prevent "silent updates"
Actually used version:
15.5-1.pgdg120+1(for this moment)Also we should consider to use
pg_upgradetool during switching major versions.https://www.postgresql.org/docs/15/pgupgrade.html