I have a standard postgresql server from a new and an old ubuntu repository.
The first is postgresql server 8.3.12. Here the lower() function works correctly on the Danish letter 'Æ'
go=# select lower('Æ');
lower
-------
æ
(1 row)
Now on postgres 9.1.9 the function doesn't work (it returns the same uppercase letter)
go=# select lower('Æ');
lower
-------
Æ
(1 row)
Does anyone have an idea how to change this behavior?
(my real problem is that ilike doesn't work on Danish characters either, but I thought the above example would make the problem more clear)
Your database was probably created with a different locale.
Check \l+ in psql on the old and new versions. They'll have different locale settings.
Other possibilities are different operating systems/versions. PostgreSQL uses libc's locale rules, and some platforms (notably Mac OS X) have a bit of a ... special ... libc.
On 9.1.9 with an en_AU.UTF-8 database running on Fedora 19 I get:
regress=> select lower('Æ');
lower
-------
æ
(1 row)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With