WARNING: database "postgres" has a collation version mismatch

RolandK

Famous Member
Mar 5, 2019
1,039
233
108
52
Hello,

on latest updates i get

WARNING: database "postgres" has a collation version mismatch
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.41.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.

in console.

do i need to fix this as stated?

i'm a little bit confused as at https://pmg.proxmox.com/wiki/Upgrade_from_8_to_9 there is told

"postgresql may print warnings regarding about collation version mismatch
These are transitory and will disappear once the cluster has been upgraded to the new version."
 
did you upgrade the postgres cluster? (did you drop the old postgres cluster after the upgrade)? here the warnings went away latest after a reboot with the system using the postgres version from trixie (without the need to run the alter database statement)

I hope this helps!
 
we upgraded from 8 to 9 a while ago, this time i did just apt update/upgrade and got this message. don't know if this is new or did exist since the upgrade from 8 to 9

reboot does not fix it - still get this message on entering psql tool

Code:
root@pmg:~# su - postgres
postgres@pmg:~$ psql
WARNING:  database "postgres" has a collation version mismatch
DETAIL:  The database was created using collation version 2.36, but the operating system provides version 2.41.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
psql (17.6 (Debian 17.6-0+deb13u1), server 15.14 (Debian 15.14-0+deb12u1))
Type "help" for help.

i'm a little bit confused which this is called "cluster" as this is a single node installation.


are the following commands the right method to fix it ?

Code:
REINDEX DATABASE postgres;
ALTER DATABASE postgres REFRESH COLLATION VERSION;
 
Last edited: