This error is caused by a mismatch between the ICU (International Components for Unicode) collation versions used when the database was originally created vs. what the upgraded OS provides.
To fix it, I ran the following SQL command inside psql
:
ALTER DATABASE template1 REFRESH COLLATION VERSION;
If it succeeds, you’ll see output similar to this:
postgres=# ALTER DATABASE template1 REFRESH COLLATION VERSION;
NOTICE: changing version from 1540.3,1540.3 to 1541.2,1541.2
ALTER DATABASE
This tells PostgreSQL to accept and update the stored collation version to match the new OS-provided version.