Re: postgreSQL UPPER Method is converting the character "µ" into "M" - Mailing list pgsql-general

From Laurenz Albe
Subject Re: postgreSQL UPPER Method is converting the character "µ" into "M"
Date
Msg-id f14b874dfa12ecbdb05d0f9c773cfe18a0ff8977.camel@cybertec.at
Whole thread Raw
In response to postgreSQL UPPER Method is converting the character "µ" into "M"  (Sai Teja <saitejasaichintalapudi@gmail.com>)
List pgsql-general
On Wed, 2023-09-06 at 19:34 +0530, Sai Teja wrote:
> Actually we are migrating the data from DB2 to postgreSQL. So in DB2 the upper method is converting µ as µ only but
notas M. 

Then you are using a different collation in DB2, or "upper" (which is not standardized,
as far as I know), is defined differently there.

> So, while validating the data we have encountered this problem.
>
> We want to have the data in both DB's should be similar (db2 and postgreSQL)
>
> In my local it is windows OS and locale is English_united_states.1252 and in local it is converting as expected (
testµinto TESTµ) 
>
> So, even I want to change locale i cannot change now. Since already db is created. BTW this db is hosted in azure.
>
> Would request to please suggest if any alternatives are there to resolve this issue. 

Specify a collation that does what you want explicitly:

SELECT upper('testµ' COLLATE "C");

 upper
═══════
 TESTµ
(1 row)

But then don't complain if your "ö" and "é" are not uppercased either.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Sai Teja
Date:
Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"
Next
From: Erik Wienhold
Date:
Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"