Contents
pg_collation_actual_version()
A function returning the actual version of the collation object
pg_collation_actual_version()
is a system function returning the actual version of the collation object as currently installed in the operating system.
pg_collation_actual_version()
was added in PostgreSQL 10.
Usage
pg_collation_actual_version (oid
) →text
If the version returned by this function is different from the value in the collversion
column in pg_collation
, then objects depending on the collation might need to be rebuilt using ALTER COLLATION ... REFRESH VERSION
.
Change history
- PostgreSQL 16
- made effective with the default collation instead of returning
NULL
(commit 10932ed5)
- made effective with the default collation instead of returning
- PostgreSQL 10
- added (commit eccfef81)
Examples
Usage example for pg_collation_actual_version()
:
postgres=# CREATE TABLE foo (id INT NOT NULL, val TEXT COLLATE "de_DE.utf8"); CREATE TABLE postgres=# SELECT pg_describe_object(refclassid, refobjid, refobjsubid) AS "Collation", pg_describe_object(classid, objid, objsubid) AS "Object", c.collversion,
pg_collation_actual_version(c.oid) FROM pg_depend d JOIN pg_collation c ON (refclassid = 'pg_collation'::regclass AND refobjid = c.oid) ORDER BY 1, 2; Collation | Object | collversion | pg_collation_actual_version ------------------------+-------------------------+-------------+----------------------------- collation "de_DE.utf8" | column val of table foo | 2.28 | 2.28
References
- PostgreSQL documentation: Collation Management Functions