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

From: Joe Conway <mail(at)joeconway(dot)com>
To: Helmut Bender <hab(at)helmut-bender(dot)de>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"
Date: 2023-09-07 12:44:37
Message-ID: 80932f61-8564-7533-eb65-d91916328cd1@joeconway.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/6/23 11:22, Helmut Bender wrote:
> Am 06.09.23 um 16:04 schrieb Sai Teja:
>> 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µ)
>
> You wrote PostgreSQL is hosted on an utf-8 system. That's why it's
> working different.
>
> And be careful: the M isn't the uppercase latin m, but in fact the
> uppercase µ (U+039C in unicode)! If you would compare it to latin
> alphabet 'TESTM' it would be different.

Yep, there are interactions between the encoding used by your terminal,
the server encoding, and the client encoding.

You have to be particularly careful when cutting and pasting that the
client encoding and your terminal encoding match or you can get
surprising results.

--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2023-09-07 13:29:56 Re: ERROR: stack depth limit exceeded
Previous Message David Rowley 2023-09-07 10:48:06 Re: Query performance going from Oracle to Postgres