pg_database_collation_actual_version()

A function returning the actual version of the database's collation

pg_database_collation_actual_version() is a system function returning the actual version of the  database's collation as currently installed in the operating system.

pg_database_collation_actual_version() was added in PostgreSQL 15.

Usage

pg_database_collation_actual_version ( oid ) → text

If the version returned by this function is different from the value in the datcollversion column in pg_database, then the database's collation might need to be rebuilt using ALTER DATABASE ... REFRESH COLLATION VERSION.

Change history

Examples

Usage example for pg_database_collation_actual_version():

postgres=# SELECT datname,
                  datcollate,
                  datcollversion,
                  pg_database_collation_actual_version(oid)
             FROM pg_database;
  datname  | datcollate | datcollversion | pg_database_collation_actual_version 
-----------+------------+----------------+--------------------------------------
 postgres  | en_GB.utf8 | 2.28           | 2.28
 template1 | en_GB.utf8 | 2.28           | 2.28
 template0 | en_GB.utf8 |                | 2.28
(3 rows)

Categories

Collation, Locale and character set handling, System function

See also

pg_collation_actual_version(), pg_import_system_collations(), ALTER DATABASE