Re: Custom collations, collation modifiers (eg case-insensitive) - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Custom collations, collation modifiers (eg case-insensitive)
Date
Msg-id 52C0C615.6080409@2ndquadrant.com
Whole thread Raw
In response to Custom collations, collation modifiers (eg case-insensitive)  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Custom collations, collation modifiers (eg case-insensitive)
List pgsql-hackers
On 12/30/2013 08:49 AM, Craig Ringer wrote:
> One of the big appeals of the new COLLATE feature was, to me, the
> possibility that we'd be able to support custom collations including
> case-insensitive collations in future.
> 
> It's something I'd like to tackle one day, and in the mean time want to
> pop on the TODO so it's not lost and forgotten. Everyone OK with that?
> 
> 
> [TODO] User-defined collations or collation modifiers/filters
> 
> [TODO] Provide a built-in case-insensitive collation modifier, i.e.
> COLLATE ... CASE INSENSITIVE, or current-collation case insensitive as
> COLLATE CASE INSENSITIVE.

The SQL 20xx draft I'm working from does not appear to specify
subclauses to COLLATE, and vendors that use COLLATE for case insensitive
comparisions appear to do so with extended collation names. So any kind
of "CASE INSENSITIVE" modifier would be an extension.

It has CREATE CHARACTER SET (11.41) and CREATE COLLATION (11.43). CREATE
COLLATION offers control over space padding, but not case.

It might be better to just offer variants of all supported collations
that ignore (a) case, (b) case and accents, or (c) just accents. The
only problem with that is that you can't say "give me the case
insensitive variant of whatever the current locale's default collation
is", you have to specify the collation.

(I intensely dislike the idea of ignoring accents, but it's something
some people appear to need/want, and is supported by other vendors).

Anyway, I just wanted to raise this as a future TODO. Back to trying to
work out issues in updatable s.b. views.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Custom collations, collation modifiers (eg case-insensitive)
Next
From: Craig Ringer
Date:
Subject: Re: control to don't toast one new type