Locale
The vsql \locale
command displays the current locale setting or lets you set a new locale for the session.
This command does not alter the default locale for all database sessions. To change the default for all sessions, set the DefaultSessionLocale
configuration parameter.
Viewing the Current Locale Setting
To view the current locale setting, use the vsql command \locale, as follows:
=> \locale
en_US@collation=binary
Overriding the Default Local for a Session
To override the default local for a specific session, use the vsql command \locale <ICU-locale-identifier>. The session locale setting applies to any subsequent commands issued in the session.
For example:
\locale en_GBINFO: INFO 2567: Canonical locale: 'en_GBINFO:' Standard collation: 'LEN' English (GBINFO:)
Notes
The server locale settings impact only the collation behavior for server-side query processing. The client application is responsible for ensuring that the correct locale is set in order to display the characters correctly. Below are the best practices recommended by OpenText to ensure predictable results:
- The locale setting in the terminal emulator for vsql (POSIX) should be set to be equivalent to session locale setting on server side (ICU) so data is collated correctly on the server and displayed correctly on the client.
- The vsql locale should be set using the POSIX LANG environment variable in terminal emulator. Refer to the documentation of your terminal emulator for how to set locale.
- Server session locale should be set using the set as described in Specify the Default Locale for the Database.
- Note that all input data for vsql should be in UTF-8 and all output data is encoded in UTF-8.
- Non UTF-8 encodings and associated locale values are not supported.