Add standard collation UNICODE

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Add standard collation UNICODE
Date: 2023-03-01 10:09:52
Message-ID: 1293e382-2093-a2bf-a397-c04e8f83d3c2@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The SQL standard defines several standard collations. Most of them are
only of legacy interest (IMO), but two are currently relevant: UNICODE
and UCS_BASIC. UNICODE sorts by the default Unicode collation algorithm
specifications and UCS_BASIC sorts by codepoint.

When collation support was added to PostgreSQL, we added UCS_BASIC,
since that could easily be mapped to the C locale. But there was no
straightforward way to provide the UNICODE collation. (Recall that
collation support came several releases before ICU support.)

With ICU support, we can provide the UNICODE collation, since it's just
the root locale. I suppose one hesitation was that ICU was not a
standard feature, so this would create variations in the default catalog
contents, or something like that. But I think now that we are drifting
to make ICU more prominent, we can just add that anyway. I think being
able to say

COLLATE UNICODE

instead of

COLLATE "und-x-icu"

or whatever it is, is pretty useful.

So, attached is a small patch to add this.

Attachment Content-Type Size
0001-Add-standard-collation-UNICODE.patch text/plain 3.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wangw.fnst@fujitsu.com 2023-03-01 10:16:40 RE: Rework LogicalOutputPluginWriterUpdateProgress
Previous Message Jehan-Guillaume de Rorthais 2023-03-01 09:46:12 Re: Memory leak from ExecutorState context?