Re: Latest on CITEXT 2.0 - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Latest on CITEXT 2.0
Date
Msg-id 7998C08A-D40B-4081-A343-1EA1B3FA7976@kineticode.com
Whole thread Raw
In response to Re: Latest on CITEXT 2.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Latest on CITEXT 2.0  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Jun 26, 2008, at 10:02, Tom Lane wrote:

> BTW, I don't think you can use that same-length optimization for
> citext.  There's no reason to think that upper/lowercase pairs will
> have the same length all the time in multibyte encodings.

I was wondering about that. I had been thinking of canonically-
equivalent stings and combining marks. Doing a quick test it looks
like combining marks are not equivalent. For example, this returns
false:

   SELECT 'Ä'::text = 'Ä'::text;

At least with en_US.UTF-8. Hrm. It looks like my client makes them
both canonical, so I've attached a script demonstrating this issue.

Anyway, I was aware of different byte counts for canonical
equivalence, but not for differences between upper- and lowercase
characters. I'd certainly defer to your knowledge of how these things
truly work in PostgreSQL, Tom, and can of course easily remove that
optimization. So, are your certain about this?

Many thanks,

David



Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Latest on CITEXT 2.0
Next
From: Tom Lane
Date:
Subject: Re: Regd: TODO Item