Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > Re: PATCH: CITE...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 9632 of 11009
Post > Topic >>

Re: PATCH: CITEXT 2.0

by david@[EMAIL PROTECTED] ("David E. Wheeler") Jul 5, 2008 at 05:46 PM

On Jul 5, 2008, at 02:58, Gregory Stark wrote:

>>    txt =3D cilower( PG_GETARG_TEXT_PP(0) );
>>    str =3D VARDATA_ANY(txt);
>>
>>    result =3D hash_any((unsigned char *) str, VARSIZE_ANY_EXHDR(txt));
>
> I thought your data type implemented a locale dependent collation,=20=20
> not just
> a case insensitive collation. That is, does this hash agree with your
> citext_eq on strings like "foo bar" <=3D> "foobar" and "foo=DF"
<=3D>=20=
=20
> "fooss" ?

CITEXT is basically intended to replace all those queries that do=20=20
`WHERE LOWER(col) =3D LOWER(?)` by doing it internally. That's it.
It's=20=
=20
locale-aware to the same extent that `LOWER()` is (and that citext 1.0=20=
=20
is not, since it only compares ASCII characters case-insensitively).=20=20
And I expect that it does, in fact, agree with your examples, in
that=20=20
all the current tests for =3D and <> pass:

try=3D# select 'foo bar' =3D 'foobar';
  ?column?
----------
  f

try=3D# SELECT 'foo=DF' =3D 'fooss';
  ?column?
----------
  f

> You may have to use strxfrm

In the patch against CVS HEAD, it uses str_tolower() in formatting.c.

Best,

David


--=20
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
 




 2 Posts in Topic:
Re: PATCH: CITEXT 2.0
stark@[EMAIL PROTECTED]   2008-07-05 10:58:04 
Re: PATCH: CITEXT 2.0
david@[EMAIL PROTECTED]   2008-07-05 17:46:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 7:56:22 CST 2008.