Bjoern Metzdorf <bm@turtle-entertainment.de> writes:
> CREATE INDEX foobar_uvalue_key ON foobar USING btree
> (upper((value)::text));
> ERROR: invalid multibyte character for locale
> HINT: The server's LC_CTYPE locale is probably incompatible with the
> database encoding.
> I forgot to say that I am using UNICODE for database encoding (initdb -E
> UNICODE and createdb -E UNICODE).
Well, in that case your encoding is indeed at variance with your locale
setting ;-). Perhaps you should declare the encoding as SQL_ASCII.
The immediate problem is that mbstowcs() is being called and it
evidently doesn't know what to do in C locale. SQL_ASCII (or any
single-byte encoding) would bypass this code path and avoid the
error.
regards, tom lane