]> begriffs open source - ai-pg/blob - full-docs/txt/catalog-pg-collation.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / catalog-pg-collation.txt
1
2 52.12. pg_collation #
3
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.
7
8    Table 52.12. pg_collation Columns
9
10    Column Type
11
12    Description
13
14    oid oid
15
16    Row identifier
17
18    collname name
19
20    Collation name (unique per namespace and encoding)
21
22    collnamespace oid (references pg_namespace.oid)
23
24    The OID of the namespace that contains this collation
25
26    collowner oid (references pg_authid.oid)
27
28    Owner of the collation
29
30    collprovider char
31
32    Provider of the collation: d = database default, b = builtin, c = libc,
33    i = icu
34
35    collisdeterministic bool
36
37    Is the collation deterministic?
38
39    collencoding int4
40
41    Encoding in which the collation is applicable, or -1 if it works for
42    any encoding
43
44    collcollate text
45
46    LC_COLLATE for this collation object. If the provider is not libc,
47    collcollate is NULL and colllocale is used instead.
48
49    collctype text
50
51    LC_CTYPE for this collation object. If the provider is not libc,
52    collctype is NULL and colllocale is used instead.
53
54    colllocale text
55
56    Collation provider locale name for this collation object. If the
57    provider is libc, colllocale is NULL; collcollate and collctype are
58    used instead.
59
60    collicurules text
61
62    ICU collation rules for this collation object
63
64    collversion text
65
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.
69
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.
81
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.