Contents
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
- PostgreSQL 15
- added (commit 37851a8b)
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)
References
- PostgreSQL 15 documentation: Collation Management Functions