Updated on 2025-10-23 GMT+08:00

collations

The collations view provides information about collations for each character set. For details, see Table 1. This view is read-only. All users have the read permission on this view.

Table 1 information_schema.collations columns

Name

Type

Description

COLLATION_NAME

varchar(32)

Name of the collation.

CHARACTER_SET_NAME

varchar(32)

Name of the character set with which the collation is associated.

ID

bigint

Collation id. For details, see pg_collation.id.

IS_DEFAULT

varchar(3)

Specifies whether the collation is the default for its character set.

IS_COMPILED

varchar(3)

Specifies whether the character set is compiled into the server.

SORTLEN

bigint

Related to the amount of memory required to sort strings expressed in the character set. This column is not supported in the current version, and the value is null.

The control behavior of the GUC parameter m_format_dev_version is forward compatible.

If the value of m_format_dev_version is set to s1, you can view the information about collation of the character sets of only the current database in the view.

m_db=# SET m_format_dev_version=s1;
SET
m_db=#
m_db=# SELECT * FROM information_schema.collations;
   COLLATION_NAME   | CHARACTER_SET_NAME | ID  | IS_DEFAULT | IS_COMPILED | SORTLEN
--------------------+--------------------+-----+------------+-------------+---------
 utf8mb4_0900_ai_ci | UTF8               | 255 |            | Yes         |
 utf8_bin           | UTF8               |  83 |            | Yes         |
 utf8_unicode_ci    | UTF8               | 192 |            | Yes         |
 utf8_general_ci    | UTF8               |  33 |            | Yes         |
 utf8mb4_bin        | UTF8               |  46 |            | Yes         |
 utf8mb4_unicode_ci | UTF8               | 224 |            | Yes         |
 utf8mb4_general_ci | UTF8               |  45 | Yes        | Yes         |
 POSIX              | UTF8               |     |            | Yes         |
 C                  | UTF8               |     |            | Yes         |
 default            | UTF8               |     |            | Yes         |
(10 rows)