↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / Collations & Encodings

default

database's default collation

Reading PG 18·Select a recorded version

Collisdeterministic
t
Collcollate
_null_
Collctype
_null_
Colllocale
_null_
Collicurules
_null_
Collversion
_null_
Collname
default
Collprovider
d
Collencoding
-1
aliases
Unknown
manual path
/docs/18/collation.html#COLLATION-MANAGING-STANDARD
signature
Unknown
source oid
100

Definition PG 18

23.2.2.1. Standard Collations

On all platforms, the following collations are supported:

unicode

This SQL standard collation sorts using the Unicode Collation Algorithm with the Default Unicode Collation Element Table. It is available in all encodings. ICU support is required to use this collation, and behavior may change if PostgreSQL is built with a different version of ICU. (This collation has the same behavior as the ICU root locale; see und-x-icu (for “undefined”).)

ucs_basic

This SQL standard collation sorts using the Unicode code point values rather than natural language order, and only the ASCII letters “A” through “Z” are treated as letters. The behavior is efficient and stable across all versions. Only available for encoding UTF8. (This collation has the same behavior as the libc locale specification C in UTF8 encoding.)

pg_unicode_fast

This collation sorts by Unicode code point values rather than natural language order. For the functions lower, initcap, and upper it uses Unicode full case mapping. For pattern matching (including regular expressions), it uses the Standard variant of Unicode Compatibility Properties. Behavior is efficient and stable within a Postgres major version. It is only available for encoding UTF8.

pg_c_utf8

This collation sorts by Unicode code point values rather than natural language order. For the functions lower, initcap, and upper, it uses Unicode simple case mapping. For pattern matching (including regular expressions), it uses the POSIX Compatible variant of Unicode Compatibility Properties. Behavior is efficient and stable within a PostgreSQL major version. This collation is only available for encoding UTF8.

C (equivalent to POSIX)

The C and POSIX collations are based on “traditional C” behavior. They sort by byte values rather than natural language order, and only the ASCII letters “A” through “Z” are treated as letters. The behavior is efficient and stable across all versions for a given database encoding, but behavior may vary between different database encodings.

default

The default collation selects the locale specified at database creation time.

Additional collations may be available depending on operating system support. The efficiency and stability of these additional collations depend on the collation provider, the provider version, and the locale.

Compare versions

Complete source facts

attributes

{"collcollate":"_null_","collctype":"_null_","collencoding":"-1","collicurules":"_null_","collisdeterministic":"t","colllocale":"_null_","collname":"default","collprovider":"d","collversion":"_null_"}

catalog

{"collcollate":"_null_","collctype":"_null_","collencoding":"-1","collicurules":"_null_","collisdeterministic":"t","colllocale":"_null_","collname":"default","collnamespace":"pg_catalog","collowner":"POSTGRES","collprovider":"d","collversion":"_null_","descr":"database's default collation","oid":"100","oid_symbol":"DEFAULT_COLLATION_OID"}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

Text language: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f