Re: default locale considered harmful? (was Re: [GENERAL]

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Sullivan <andrew(at)libertyrms(dot)info>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: default locale considered harmful? (was Re: [GENERAL]
Date: 2003-05-31 04:09:04
Message-ID: 200305310409.h4V494124130@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Has the single-byte LIKE penalty been eliminated, so we don't need to
consider using C as the default locale for initdb, right?

If fixed, how was it done?

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

Peter Eisentraut wrote:
> Tom Lane writes:
>
> > I recall someone floating a proposal that initdb should by default
> > initialize the database in C locale, not whatever-it-finds-in-the-
> > environment. To get a non-C locale you'd have to give an explicit
> > command-line switch --- essentially, reversing the sense of the present
> > "initdb --no-locale" option.
>
> If you're concerned about speed, let's think about fixing the real
> problems, not about disabling the feature altogether. A while ago I
> proposed an easy solution that made LIKE use an index based on strxfrm
> order instead. It was rejected on the grounds that it would prevent a
> future enhancement of the LIKE mechanism to use the locale-enabled
> collation order, but no one seems to be seriously interested in
> implementing that. I still have the patch; we can reconsider it if you
> like.
>
> (Btw., LIKE using the locale-enabled collation sequence is hardly going to
> work, because most locales compare strings backwards from the end to the
> start in the second pass, so something like LIKE 'foo%' can easily give
> inconsistent results, since you don't know what the end of the string
> really is. It's better to think of pattern matching as
> character-by-character matching.)
>
> --
> Peter Eisentraut peter_e(at)gmx(dot)net
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-05-31 04:32:15 Re: default locale considered harmful? (was Re: [GENERAL]
Previous Message Bruce Momjian 2003-05-31 03:07:00 Re: [HACKERS] Are we losing momentum?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-05-31 04:32:15 Re: default locale considered harmful? (was Re: [GENERAL]
Previous Message Tom Lane 2003-05-31 03:36:10 Re: Testing the return value of fclose() in the backend