select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / SYSTEM ADMINISTRATION FUNCTIONS

pg_import_system_collations

Read PG 18 manual ↗

Adds collations to the system catalog pg_collation based on all the locales it finds in the operating system.

Signatures & examples

pg_import_system_collations ( schema regnamespace ) → integer
Adds collations to the system catalog pg_collation based on all the locales it finds in the operating system. This is what initdb uses; see Section 23.2.2 for more details. If additional locales are installed into the operating system later on, this function can be run again to add collations for the new locales. Locales that match existing entries in pg_collation will be skipped. (But collation objects based on locales that are no longer present in the operating system are not removed by this function.) The schema parameter would typically be pg_catalog, but that is not a requirement; the collations could be installed into some other schema as well. The function returns the number of new collation objects it created. Use of this function is restricted to superusers.
Version history 4
  1. PG 16 → 17changed
  2. PG 13 → 14changed
  3. PG 12 → 13changed
  4. PG 9.6 → 10added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source