Re: sortsupport for text - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: sortsupport for text
Date
Msg-id CAEYLb_WJ6i7tZqpYiD+DDNKbjuRsFY_6PRXmCm0h2r4CyEJ7fQ@mail.gmail.com
Whole thread Raw
In response to Re: sortsupport for text  (Greg Stark <stark@mit.edu>)
Responses Re: sortsupport for text  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On 20 June 2012 15:10, Greg Stark <stark@mit.edu> wrote:
> On Sun, Jun 17, 2012 at 9:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The trick for hashing such datatypes is to be able to guarantee that
>> "equal" values hash to the same hash code, which is typically possible
>> as long as you know the equality rules well enough.  We could possibly
>> do that for text with pure-strcoll equality if we knew all the details
>> of what strcoll would consider "equal", but we do not.
>
> It occurs to me that strxfrm would answer this question. If we made
> the hash function hash the result of strxfrm then we could make
> equality use strcoll and not fall back to strcmp.

What about per-column collations?

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: sortsupport for text
Next
From: Jaime Casanova
Date:
Subject: Re: foreign key locks