4 The catalog pg_collation describes the available collations, which are
5 essentially mappings from an SQL name to operating system locale
6 categories. See Section 23.2 for more information.
8 Table 52.12. pg_collation Columns
20 Collation name (unique per namespace and encoding)
22 collnamespace oid (references pg_namespace.oid)
24 The OID of the namespace that contains this collation
26 collowner oid (references pg_authid.oid)
28 Owner of the collation
32 Provider of the collation: d = database default, b = builtin, c = libc,
35 collisdeterministic bool
37 Is the collation deterministic?
41 Encoding in which the collation is applicable, or -1 if it works for
46 LC_COLLATE for this collation object. If the provider is not libc,
47 collcollate is NULL and colllocale is used instead.
51 LC_CTYPE for this collation object. If the provider is not libc,
52 collctype is NULL and colllocale is used instead.
56 Collation provider locale name for this collation object. If the
57 provider is libc, colllocale is NULL; collcollate and collctype are
62 ICU collation rules for this collation object
66 Provider-specific version of the collation. This is recorded when the
67 collation is created and then checked when it is used, to detect
68 changes in the collation definition that could lead to data corruption.
70 Note that the unique key on this catalog is (collname, collencoding,
71 collnamespace) not just (collname, collnamespace). PostgreSQL generally
72 ignores all collations that do not have collencoding equal to either
73 the current database's encoding or -1, and creation of new entries with
74 the same name as an entry with collencoding = -1 is forbidden.
75 Therefore it is sufficient to use a qualified SQL name (schema.name) to
76 identify a collation, even though this is not unique according to the
77 catalog definition. The reason for defining the catalog this way is
78 that initdb fills it in at cluster initialization time with entries for
79 all locales available on the system, so it must be able to hold entries
80 for all encodings that might ever be used in the cluster.
82 In the template0 database, it could be useful to create collations
83 whose encoding does not match the database encoding, since they could
84 match the encodings of databases later cloned from template0. This
85 would currently have to be done manually.