Re: Locale timings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Locale timings
Date: 2001-11-27 00:21:15
Message-ID: 16270.1006820475@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-11-27 00:23:17 Re: Minor buglet in update...from (I think)
Previous Message Tom Lane 2001-11-26 23:44:07 Re: DEBUG lines in server log