Re: PATCH: CITEXT 2.0

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: PATCH: CITEXT 2.0
Дата
Msg-id 87mykwwt3n.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: PATCH: CITEXT 2.0  ("David E. Wheeler" <david@kineticode.com>)
Ответы Re: PATCH: CITEXT 2.0  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
"David E. Wheeler" <david@kineticode.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!


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: PATCH: CITEXT 2.0