select lower('ÆØÅ ABC'); does not work as expected

Поиск
Список
Период
Сортировка
Искать

select lower('ÆØÅ ABC'); does not work as expected

От:
willy malth <donotemailme@nosuchdomain.xx>
Дата:
Hi there!

I'm useing postgresql 7.3.2, and having trouble with the lower(string) 
function and the Danish special chars:


mydatabase=> select lower('ÆØÅ ABC');
   lower
---------
  ÆØÅ abc
(1 row)

The Danish chars does not convert to lower chars.

I've seen answers to this problem, suggesting a configure option called 
--enable-locale, but this does not apply to 7.3.2 as it says in the 
release notes: "Both multibyte and locale support are now always 
enabled.". The --enable-locale option is no longer there.

Any ideas?


Re: select lower('ÆØÅ ABC'); does not work as expected

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
willy malth  writes:
> I'm useing postgresql 7.3.2, and having trouble with the lower(string) 
> function and the Danish special chars:
> The Danish chars does not convert to lower chars.

You need to run initdb in the correct locale.  LC_COLLATE and LC_CTYPE
are both locked down at initdb time, and the latter determines the
behavior of lower().  You could use pg_controldata to check the
database's LC_CTYPE, but I'll bet that it's not a Danish locale.

			regards, tom lane

Re: select lower('ÆØÅ ABC'); does

От:
Markus Bertheau <twanger@bluetwanger.de>
Дата:
В Вск, 25.05.2003, в 05:07, Tom Lane пишет:

> You need to run initdb in the correct locale.  LC_COLLATE and LC_CTYPE
> are both locked down at initdb time, and the latter determines the
> behavior of lower().  You could use pg_controldata to check the
> database's LC_CTYPE, but I'll bet that it's not a Danish locale.
> 

bert@saphir bert $ su - 
Password: 
saphir root # su - postgres
postgres@saphir postgresql $ pg_controldata /var/lib/postgresql/data/ |
grep LC
LC_COLLATE:                           ru_RU.UTF-8
LC_CTYPE:                             ru_RU.UTF-8
postgres@saphir postgresql $ logout
saphir root # logout
bert@saphir bert $ psql template1 postgres
Добро пожаловать в psql 7.3.2 - Интерактивный Терминал PostgreSQL.

template1=# select lower('äÄöÖüÜабвгдАБВГД');
              lower               
----------------------------------
 äÄöÖüÜабвгдАБВГД
(1 запись)

template1=# \q
bert@saphir bert $ 

What gives?

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.

FAQ