Hi all,
Normally, when DB_LOCALE is not defined, a CREATE DATABASE will use by default the ISO8859-1 encoding.
I know also that when setting a DB_LOCALE that does not match the database locale, you get the following error at connection:
23197: Database locale information mismatch.
Now can someone explain the following (using IDS 14.10.FC4W1WE on Debian 10):
1) I create a DB with no DB_* settings (should default to ISO8859-1 right?)
2) I set DB_LOCALE=en_us.utf8 (as well as CLIENT_LOCALE=en_us.utf8)
3) I can connect to my DB!
What I am missing here?
(I assume that I am using the correct query to get the current DB locale!)
sf@toro:~$ locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=POSIX
sf@toro:~$ echo $CLIENT_LOCALE $DB_LOCALE $SERVER_LOCALE (these are empty)
sf@toro:~$ dbaccess - -
> create database mydb;
Database created.
> select tabname, site from systables where tabname like ' GL%';
tabname GL_COLLATE
site en_US.57372
tabname GL_CTYPE
site en_US.57372
2 row(s) retrieved.
^C
sf@toro:~$ export DB_LOCALE=en_us.8859-1
sf@toro:~$ export CLIENT_LOCALE=en_us.8859-1
sf@toro:~$ dbaccess mydb -
23197: Database locale information mismatch.
sf@toro:~$ export DB_LOCALE=en_us.utf8
sf@toro:~$ export CLIENT_LOCALE=en_us.utf8
sf@toro:~$ dbaccess mydb -
Database selected.
>
Just to check the encoding code when creating an ISO-8859-1 DB:
sf@toro:~$ export DB_LOCALE=en_us.8859-1
sf@toro:~$ export CLIENT_LOCALE=en_us.8859-1
sf@toro:~$ dbaccess - -
> create database mydb2;
Database created.
> select tabname, site from systables where tabname like ' GL%';
tabname GL_COLLATE
site en_US.819
tabname GL_CTYPE
site en_US.819
2 row(s) retrieved.
However the doc states that when DB_LOCALE is not defined, it defaults to ISO-8859-1:
https://www.ibm.com/support/knowledgecenter/en/SSGU8G_14.1.0/com.ibm.ddi.doc/ids_ddi_082.htm
When the database server creates a database, it stores the locale of the database that is derived from the DB_LOCALE environment variable in its system catalog. This locale determines how the database server interprets character data that is stored within the database. By default, the database locale is the U.S. English locale that uses the ISO8859-1 code set. For information about how to use alternative locales, see the IBM® Informix® GLS User's Guide.
By the way where can I find in the doc the official way to check the locale of a database?
What is the code 57372 in en_US.57372 and can I find some reference list?
Seb
------------------------------
Sebastien FLAESCH
------------------------------
#Informix