Howto: Fix PostgreSQL sort collation warnings on Kali Linux
By SecBurg
If you’ve updated your Kali Linux including the PostgreSQL database and/or some tools like OpenVAS, you might get some warnings when starting up your tools (I’m using Kali with german language):
DETAIL: Die Datenbank wurde mit Sortierfolgenversion 2.40 erzeugt, aber das Betriebssystem hat Version 2.41.
HINT: Bauen Sie alle Objekte in dieser Datenbank, die die Standardsortierfolge verwenden, neu und führen Sie ALTER DATABASE gvmd REFRESH COLLATION VERSION aus, oder bauen Sie PostgreSQL mit der richtigen Bibliotheksversion.
The warnings in english are:
The database was created using collation version 2.40, but the operating system provides version 2.41.
Rebuild all objects in this database that use the default collation and run ALTER DATABASE gvmd REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
Follow these steps to fix these collation warnings:
- change to postgres user and start psql shell
su - postgres
psql
- list all databases
postgres=# \l
- change all databases which are affected
postgres=# ALTER DATABASE gvmd REFRESH COLLATION VERSION ;
HINWEIS: Version wird von 2.40 in 2.41 geändert
ALTER DATABASE
postgres=# ALTER DATABASE faraday REFRESH COLLATION VERSION ;
HINWEIS: Version wird von 2.40 in 2.41 geändert
ALTER DATABASE
postgres=# ALTER DATABASE msf REFRESH COLLATION VERSION ;
HINWEIS: Version wird von 2.40 in 2.41 geändert
ALTER DATABASE
postgres=# ALTER DATABASE postgres REFRESH COLLATION VERSION ;
HINWEIS: Version wird von 2.40 in 2.41 geändert
ALTER DATABASE
postgres=# ALTER DATABASE msf_test REFRESH COLLATION VERSION ;
HINWEIS: Version wird von 2.40 in 2.41 geändert
ALTER DATABASE
That should be it.
The PostgreSQL documentation has some more background about this.