Resolve postgres collation Mismatch
I encountered this issue after upgrading from fedora 38 to 40
WARNING: database "template1" has a collation version mismatch DETAIL: The database was created using collation version 2.37, but the operating system provides version 2.39.
Solution
connect to the specific database showing the error. In most cases all the databases,
reindex the database
refresh the collation
/c database1
> REINDEX DATABASE database1;
> ALTER DATABASE database1 REFRESH COLLATION VERSION;