Collation mega-cleanups

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Collation mega-cleanups
Date: 2011-05-09 18:58:23
Message-ID: 201105091858.p49IwNe25876@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom this collation stuff has seen more post-feature-commit cleanups than
I think any patch I remember. Is there anything we can learn from this?

Yes, this is coming from me, who some consider to be the king of
post-commit cleanups, namely, cleaning up my own commits.

---------------------------------------------------------------------------

Tom Lane wrote:
> I just noticed that the collation patch has modified char2wchar and
> wchar2char to accept a collation OID as argument ... but it hasn't done
> anything to make those arguments actually work. Since those functions
> depend on wcstombs and mbstowcs, which respond to LC_CTYPE and nothing
> else, this flat out does not work in non-default collations. What's
> more, there doesn't seem to be any such thing as wcstombs_l or
> mbstowcs_l (at least my Fedora box hasn't got them), so this can't be
> fixed within the available glibc API.
>
> Right at the moment this only affects str_tolower, str_toupper, and
> str_initcap; there are other uses of these functions in the text search
> code, but those always pass DEFAULT_COLLATION_OID.
>
> It's possible that things are not too broken in practice, because it's
> likely that the transformations done by these functions only depend on
> the encoding indicated by LC_CTYPE, and we (try to) enforce that all
> locales used in a given database match the database encoding. Still,
> that's a rather shaky chain of reasoning.
>
> The complete lack of code comments on this doesn't make me any happier
> --- in fact, the comments for char2wchar and wchar2char still claim that
> they have the same API as wcstombs and mbstowcs, which can hardly be
> considered true when they don't even have the same argument lists.
>
> Any thoughts what to do about this?
>
> regards, tom lane
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-05-09 19:00:17 Re: switch UNLOGGED to LOGGED
Previous Message Robert Haas 2011-05-09 18:51:34 Re: Formatting Curmudgeons WAS: MMAP Buffers