Re: PATCH: CITEXT 2.0
От | David E. Wheeler |
---|---|
Тема | Re: PATCH: CITEXT 2.0 |
Дата | |
Msg-id | 1D9FF20F-FFBF-4584-B6F0-D33B54B9E2CB@kineticode.com обсуждение исходный текст |
Ответ на | Re: PATCH: CITEXT 2.0 (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: PATCH: CITEXT 2.0
|
Список | pgsql-hackers |
On Jul 7, 2008, at 16:58, Tom Lane wrote: > "David E. Wheeler" <david@kineticode.com> 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
В списке pgsql-hackers по дате отправления: