Re: Latest on CITEXT 2.0 - Mailing list pgsql-hackers

From Marko Kreen
Subject Re: Latest on CITEXT 2.0
Date
Msg-id e51f66da0807010813i6aec31bp7dc37419d5964679@mail.gmail.com
Whole thread Raw
In response to Re: Latest on CITEXT 2.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Latest on CITEXT 2.0  (Bruce Momjian <bruce@momjian.us>)
Re: Latest on CITEXT 2.0  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 7/1/08, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Marko Kreen" <markokr@gmail.com> writes:
>  > On 6/26/08, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> >> BTW, I don't think you can use that same-length optimization for
>  >> citext.  There's no reason to think that upper/lowercase pairs will
>  >> have the same length all the time in multibyte encodings.
>
>  > What about this code in current str_tolower():
>
>  >         /* Output workspace cannot have more codes than input bytes */
>  >         workspace = (wchar_t *) palloc((nbytes + 1) * sizeof(wchar_t));
>
>
> That's working with wchars, not bytes.

Ah, I missed the point of char2wchar() line.

I'm rather unfamiliar with various MB API-s, sorry.

There's another thing I'm probably missing: does current code handle
multi-wchar codepoints?  Or is it guaranteed they don't happen?
(Wasn't wchar_t usually 16bit value?)

-- 
marko


pgsql-hackers by date:

Previous
From: "Radek Strnad"
Date:
Subject: [WIP] patch - Collation at database level
Next
From: Richard Huxton
Date:
Subject: Re: Does anything dump per-database config settings? (was Re: ALTER DATABASE vs pg_dump)