pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Sai Teja <saitejasaichintalapudi@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"
Date: Wed, 06 Sep 2023 16:21:12 +0200
Message-ID: <f14b874dfa12ecbdb05d0f9c773cfe18a0ff8977.camel@cybertec.at> (raw)
In-Reply-To: <CADBXDMUw6XUJkSJG1kbtPhkt2nR+cRcusKucY9Xcjhew=RAQDg@mail.gmail.com>
References: <CADBXDMXKnWKVY=5_q0Ww79dXd3e9x1M2t0S_ivVhk4VAma_Y0A@mail.gmail.com>
	<1507834.1694008417@sss.pgh.pa.us>
	<CADBXDMUw6XUJkSJG1kbtPhkt2nR+cRcusKucY9Xcjhew=RAQDg@mail.gmail.com>

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 not as 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





view thread (15+ messages)  latest in thread

Message-ID: <f14b874dfa12ecbdb05d0f9c773cfe18a0ff8977.camel@cybertec.at>
Permalink:  ../f14b874dfa12ecbdb05d0f9c773cfe18a0ff8977.camel@cybertec.at/
Also on:    postgresql.org/message-id/f14b874dfa12ecbdb05d0f9c773cfe18a0ff8977.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, saitejasaichintalapudi@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"
  In-Reply-To: <f14b874dfa12ecbdb05d0f9c773cfe18a0ff8977.camel@cybertec.at>
  References: <CADBXDMXKnWKVY=5_q0Ww79dXd3e9x1M2t0S_ivVhk4VAma_Y0A@mail.gmail.com> <1507834.1694008417@sss.pgh.pa.us> <CADBXDMUw6XUJkSJG1kbtPhkt2nR+cRcusKucY9Xcjhew=RAQDg@mail.gmail.com> <f14b874dfa12ecbdb05d0f9c773cfe18a0ff8977.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox