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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

PG Doc comments form
The following bug has been logged on the website:

Bug reference:      16286
Logged by:          Макс Лютов
Email address:      [hidden email]
PostgreSQL version: 12.2
Operating system:   Ubuntu 18.04.4 LTS
Description:        

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

Reply | Threaded
Open this post in threaded view
|

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

Tom Lane-2
PG Bug reporting form <[hidden email]> 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