Postgres upper function on turkish character does not return expected result

后端 未结 3 1005
醉话见心
醉话见心 2021-02-04 15:08

It looks like postgres upper/lower function does not handle select characters in Turkish character set.

select upper(\'Aaı\'), lower(\'Aaİ\') from          


        
3条回答
  •  再見小時候
    2021-02-04 15:29

    It seems to me that your problem is related to Windows. This is how it looks on Ubuntu (Postgres 8.4.14), database encoding UTF-8:

    test=# select upper('Aaı'), lower('Aaİ');
     upper | lower
    -------+-------
     AAI   | aai
    (1 row)
    

    My recommendation would be - if you have to use Windows - to write a stored procedure that will do the conversion for you. Use built-in replace: replace('abcdefabcdef', 'cd', 'XX') returns abXXefabXXef. There might be a more optimal solution, I do not claim that this approach is the correct one.

提交回复
热议问题