Re: Raphael Hertzog > I think it would be nice if that operation could be automated. > With dpkg triggers, it's easy to schedule a script on the postgresql > package side when libc6 (or locales?) gets upgraded. We can record the > libc6 version at installation time, and compare the version in the trigger > run, and if the major version has changed, then we run the required > ALTER DATABASE commands.
The correct default action is to reindex all text indexes. ALTER DATABASE is just a shortcut for when you know that the collation has not changed. I wouldn't want to wire that decision into postinst scripts. On Debian, it's not a problem since it only happens at release upgrade time. > PS: Not quite sure if there's a good CLI command to directly get the > "collation version". In the OS, it's the glibc version. In PG, it's pg_database.datcollversion. Christoph