Re: Does UCS_BASIC have the right CTYPE?

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Vik Fearing <vik(at)2ndquadrant(dot)fr>
Subject: Re: Does UCS_BASIC have the right CTYPE?
Date: 2023-10-26 14:49:55
Message-ID: ff0a908a-7dc3-46f8-afb3-1625237a2910@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25.10.23 20:32, Jeff Davis wrote:
> But what should the result of UPPER('á' COLLATE UCS_BASIC) be? In
> Postgres, the answer is 'á', but intuitively, one could reasonably
> expect the answer to be 'Á'.

I think that's right. But what would you put into ctype to make that
happen?

> That seems to suggest the standard answer should be 'Á' regardless of
> any COLLATE clause (though I could be misreading). I'm a bit confused
> by that... what's the standard-compatible way to specify the locale for
> UPPER()/LOWER()? If there is none, then it makes sense that Postgres
> overloads the COLLATE clause for that purpose so that users can use a
> different locale if they want.

The standard doesn't have the notion of locale-dependent case conversion.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Morris 2023-10-26 15:00:58 Re: Atomic ops for unlogged LSN
Previous Message Zhijie Hou (Fujitsu) 2023-10-26 14:41:03 RE: [PoC] pg_upgrade: allow to upgrade publisher node