Re: PATCH: CITEXT 2.0

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PATCH: CITEXT 2.0
Date: 2008-07-07 18:44:32
Message-ID: 20080707184432.GB4681@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David E. Wheeler wrote:
> On Jul 7, 2008, at 00:46, Zdenek Kotala wrote:
>
>> You have to use varstr_cmp in citextcmp. Your code is correct,
>> because for
>> < <= >= > operators you need collation sensible function.
>>
>> You need to change only citext_cmp function to use strncmp() or call
>> texteq function.
>
> I'm confused. What's the difference between strncmp() and varstr_cmp()?
> And why would I use one in one place and the other elsewhere? Shouldn't
> they be used consistently?

Not necessarily -- see texteq. I think the point is that varstr_cmp()
is a lot slower.

>> I'm think that this test will work correctly for en_US.UTF-8 at any
>> time. I guess the test make sense only when Czech collation
>> (cs_CZ.UTF-8) is selected, but unfortunately, you cannot change
>> collation during your test :(.
>
> No, I was wondering before what locale was used for initdb on the build
> farm. I mean, how are locale-aware things really tested?

They aren't AFAIK.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2008-07-07 18:47:23 Re: PATCH: CITEXT 2.0
Previous Message Adriano Lange 2008-07-07 18:42:13 GEQO Publications