meta data for this page
  •  

ALTER CHARACTER SET

Available in: DSQL

Added in: 2.5

Description

With ALTER CHARACTER SET, the default collation of a character set can be changed. This will affect all future usage of the character set, except where overridden by an explicit COLLATE clause. The collation of existing domains, columns and PSQL variables will not be changed.

Syntax

ALTER CHARACTER SET charset SET DEFAULT COLLATION collation

Example

alter character set utf8 set default collation unicode_ci_ai

Notes:

  • If you use SET DEFAULT COLLATION on the default character set of the database, you have effectively set (or overridden) the default collation for the database.
  • If you use SET DEFAULT COLLATION on the connection character set, string constants will be interpreted according to the new default collation (unless character set and/or collation are overridden). In most situations, this will make no difference, but comparisons may have another outcome if the collation changes.