Re: PATCH: CITEXT 2.0

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Teodor Sigaev" <teodor(at)sigaev(dot)ru>, "Zdenek Kotala" <Zdenek(dot)Kotala(at)Sun(dot)COM>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: CITEXT 2.0
Date: 2008-07-05 09:58:04
Message-ID: 87mykwwt3n.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> writes:

> On Jul 3, 2008, at 09:53, Alvaro Herrera wrote:
>
>>> Thanks. What would citext_hash() look like? I don't see a text_hash() to
>>> borrow from anywhere in src/.
>>
>> See hash_any(). I assume the difficulty is making sure that
>> hash("FOO") = hash("foo") ...
>
> Great, big help, thank you. So does this look sensible?
>
> txt = cilower( PG_GETARG_TEXT_PP(0) );
> str = VARDATA_ANY(txt);
>
> result = hash_any((unsigned char *) str, VARSIZE_ANY_EXHDR(txt));

I thought your data type implemented a locale dependent collation, not just
a case insensitive collation. That is, does this hash agree with your
citext_eq on strings like "foo bar" <=> "foobar" and "fooß" <=> "fooss" ?

You may have to use strxfrm

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-07-05 09:58:39 Re: PATCH: CITEXT 2.0
Previous Message Simon Riggs 2008-07-05 09:50:35 Re: Explain XML patch v2