Re: Locale timings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Locale timings
Date
Msg-id 16270.1006820475@sss.pgh.pa.us
Whole thread Raw
In response to Locale timings  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> However, I feel that we could reasonably cope with this situation by
> replacing

> #ifdef USE_LOCALE
> /* locale-aware code */
> #else
> /* non-locale code */
> #endif

> with

> if (locale_is_not_C)
> {
>     /* locale-ware code */
> }
> else
> {
>     /* non-locale code */
> }

> This practice should have minuscule impact,

Except perhaps on the size of the executable ;-).  However, USE_LOCALE
affects little enough stuff that that's probably not a big objection.

A possibly more serious objection is whether there are still any systems
out there that don't *have* locale support, and will give us build
errors on <locale.h> or strcoll() or some such.  It looks like
<locale.h> is required by ANSI C, so I think we can get away with this;
does anyone still care about, eg, SunOS 4.1.x?  (One could imagine
providing a stub implementation that equates strcoll() to strcmp() and
so forth, if anyone still does care.)

One nice point is that this will actually make things faster for the
case of locale-enabled-code-running-in-C-locale, which I suspect is not
uncommon, particularly for RPM users.

I'm for it ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: insert/update/delete statements returning a query response
Next
From: Bruce Momjian
Date:
Subject: Re: Minor buglet in update...from (I think)