BUG #16286: Некорректно работает функция lower

Started by PG Bug reporting formabout 6 years ago2 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 16286
Logged by: Макс Лютов
Email address: lyutovmax@gmail.com
PostgreSQL version: 12.2
Operating system: Ubuntu 18.04.4 LTS
Description:

Запрос select lower(convert_from(convert_to('ТеСт', 'UTF8'), 'UTF8'))
возвращает 'ТеСт' , а не 'тест'

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: BUG #16286: Некорректно работает функция lower

PG Bug reporting form <noreply@postgresql.org> writes:

Запрос select lower(convert_from(convert_to('ТеСт', 'UTF8'), 'UTF8'))
возвращает 'ТеСт' , а не 'тест'

I don't speak Russian, but try it like this:

ru=# select lower(convert_from(convert_to('ТеСт', 'UTF8'), 'UTF8' collate "default"));
lower
-------
тест
(1 row)

Without that, the collation of the expression works out as "C" because
convert_from's second argument is of type "name", which since v12
has default collation "C". Then lower() won't do anything with
non-ASCII letters.

regards, tom lane