Skip to main content
Version: 2.0.0 (latest)

3.13. Collations

Collations are objects that allow for the sorting mode and character classification behavior to be specified either per column or per operation. Collations can be used to override the way data is sorted in a database, even if the database has its modes defined by LC_COLLATE and LC_CTYPE attributes.

ch3.collation-dialog.general1

General
#FieldDescription
1Collation

An existing collation from which the new collation is created (FROM). Selecting it clears the fields Locale, LC_COLLATE, and LC_CTYPE.

ch3.collation-dialog.attributes123456789

Attributes
#FieldGroup boxDescription
1LocaleBasics

A shortcut to specify the attributes LC_COLLATE and LC_CTYPE at once (LOCALE). Filling it clears the base collation and the fields of the groups LC_COLLATE and LC_CTYPE.

2EncodingBasics

The character set (encoding) in which the collation works.

3ModifierBasics

Present in the groups Basics, LC_COLLATE, and LC_CTYPE, this field can be used to provide extra modifiers (like a custom currency code) to the locale. The modifier is any value specified after the character @.

4ProviderBasics

The provider that supplies the locale services associated with the collation: libc or icu. Default leaves the choice to PostgreSQL.

5DeterministicBasics

Indicates that the collation is deterministic. A deterministic collation considers strings that are not byte-wise equal to be unequal, even if the comparison considers them logically equal.

6LanguageLC_COLLATE

The language (locale) used for string sorting (LC_COLLATE). The values listed are platform-dependent; leave it as Not defined if unsure. You can type a value that isn't listed. Selecting a value clears the base collation and Locale.

7LanguageLC_CTYPE

The language (locale) used for character classification, such as upper, lower, and digit (LC_CTYPE). The values listed are platform-dependent; leave it as Not defined if unsure. You can type a value that isn't listed. Selecting a value clears the base collation and Locale.

8ModifierLC_COLLATE

The modifier is any value specified after the character @. For example: en_US.utf8@modifier

9ModifierLC_CTYPE

The modifier is any value specified after the character @. For example: en_US.utf8@modifier

note

Note: The attributes Collation, Locale, LC_COLLATE, and LC_CTYPE are mutually exclusive: you can use only one of them at a time.

References​

Collation DDL
https://www.postgresql.org/docs/current/static/sql-createcollation.html