On Jul 7, 2008, at 16:58, Tom Lane wrote:
"David E. Wheeler" <[EMAIL PROTECTED]> writes:
Hrm. So in your opinion, strncmp() could be used for all comparisons
by citext, rather than varstr_cmp()?
I thought the charter of this type was to work like lower(textcol).
Correct.
If that's so, you certainly can't use strncmp, because that would
result
in sort orderings totally different from lower()'s result. Even
without
that argument, for most multibyte cases you'd get a pretty arbitrary,
user-unfriendly sort ordering.
Now I'm confused again. :-( Whether or not I use strncmp() or
varstr_cmp(), I first lowercase the value to be compared using
str_tolower(). What Zdenek has said is, that aside, just as for the
TEXT type, I should use strncmp() for = and <>, and varstr_cmp() for
everything else. Are you saying something different?
I could use some examples to play with in order to ensure that things
are behaving as they should. I'll add regression tests for them.
Thanks,
David
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers