Re: postgreSQL UPPER Method is converting the character "µ" into "M"

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Sai Teja <saitejasaichintalapudi(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"
Date: 2023-09-06 14:23:28
Message-ID: 60182986.61.1694010208406@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/09/2023 15:42 CEST Sai Teja <saitejasaichintalapudi(at)gmail(dot)com> wrote:

> I am using UPPER document name for converting the text from lower case into
> upper case.
> But here for the below example
> Command:- select UPPER(testµ)
> Input :- testµ
> Output:- TESTM
> Expected output :- TESTµ
>
> Here, that character is converting into M which should not be case
> The postgreSQL is hosted in Linux Machine which is using Locale_ctype:- en_US_utf.8

Use can use collation C or ucs_basic if you want to uppercase ASCII only:

postgres=# SELECT upper('testµ' COLLATE "C");
upper
-------
TESTµ
(1 row)

--
Erik

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albrecht Dreß 2023-09-06 14:51:27 Q: inet operators for IPv4 encapsulated in IPv6
Previous Message Laurenz Albe 2023-09-06 14:21:12 Re: postgreSQL UPPER Method is converting the character "µ" into "M"