Collation¶
A collation is a schema object that provides the locale rules used when sorting and comparing text.
Properties¶
| Property | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | The name of the collation function to create. |
schema |
string |
yes | The schema to create the collation function in. |
owner |
string |
yes | The role that owns the collation function. |
sql |
string |
— | Raw SQL for the object. |
locale |
string |
— | This is a shortcut for setting lc_collate and lc_ctype at once. If you specify this, you cannot specify either of those parameters. |
lc_collate |
string |
— | Use the specified operating system locale for the LC_COLLATE locale category. |
lc_ctype |
string |
— | Use the specified operating system locale for the LC_CTYPE locale category. |
provider |
icu | libc |
— | Specifies the provider to use for locale services associated with this collation. Possible values are: icu, libc. libc is the default. The available choices depend on the operating system and build options. |
version |
string |
— | Specifies the version string to store with the collation. Normally this should be omitted, which causes the version to be computed from the actual version of the collation as provided by the operating system. |
rules |
string |
— | Tailoring rules for an ICU collation, in ICU's rule syntax (PostgreSQL 16 and later). |
deterministic |
boolean |
— | Specifies whether the collation should use deterministic comparisons. Default: true. |
copy_from |
string |
— | Copy the collation from a pre-existing collation. |
comment |
string |
— | An optional comment about the collation. |
dependencies |
dependencies | — | Database objects this object is dependent upon. |
Mutually exclusive forms¶
Exactly one of these must hold:
sqlcopy_from
Source: schemata/collation.yml · Resolved JSON Schema: collation.json