SET LOCALE

Specifies locale for the current session.

Syntax

SET LOCALE TO ICU‑locale‑identifier

Parameters

ICU‑locale‑identifier

Specifies the ICU locale identifier to use, by default set to:

en_US@collation=binary

You can also use the vsql command \locale to set the current locale. An unqualified \locale command shows the current setting:

=> \locale
en_GB
=> \locale en_US@collation=binary;
INFO 2567:  Canonical locale: 'en_US'
Standard collation: 'LEN_KBINARY'
English (United States)
=> \locale
en_US@collation=binary;

If set to null, Vertica sets locale to en_US_POSIX:

=> set locale to '';
INFO 2567:  Canonical locale: 'en_US_POSIX'
Standard collation: 'LEN'
English (United States, Computer)
SET

The following requirements apply:

  • Vertica only supports the COLLATION keyword.
  • Single quotes are mandatory to specify collation.

For a complete list of locale identifiers, see the ICU Project

Privileges

None

Commonly Used Locales

de_DE German (Germany)
en_GB English (Great Britain)
es_ES Spanish (Spain)
fr_FR French (France)
pt_BR

Portuguese (Brazil)

pt_PT Portuguese (Portugal)
ru_RU Russian (Russia)
ja_JP Japanese (Japan)
zh_CN Chinese (China, simplified Han)
zh_Hant_TW Chinese (Taiwan, traditional Han)

Examples

Set session locale to en_GB:

=> SET LOCALE TO en_GB;
INFO 2567:  Canonical locale: 'en_GB'
Standard collation: 'LEN'
English (United Kingdom)
SET

Use the short form of a locale:

=> SET LOCALE TO LEN;
INFO 2567:  Canonical locale: 'en'
Standard collation: 'LEN'
English
SET

Specify collation:

=> SET LOCALE TO 'tr_tr@collation=standard';
INFO 2567:  Canonical locale: 'tr_TR@collation=standard'
Standard collation: 'LTR'
Turkish (Turkey, collation=standard)  Türkçe (Türkiye, Sıralama=standard)
SET