Re: RPM init-script: Why the locale setting?

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Troels Arvin <troels(at)arvin(dot)dk>
Cc: "pgsql-general (at) postgresql (dot) org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: RPM init-script: Why the locale setting?
Date: 2004-04-04 22:33:24
Message-ID: 20040404233324.A2892@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 04/04/2004 21:48 Troels Arvin wrote:
> Hello,
>
> In the init-script contained in the RPMs downloadable from the PostgreSQL
> site (I checked the one for Fedora), an explicit locale is set before
> running initdb. - And the explicit locale is not "C".
>
> This means that a PostgreSQL installation will not use indexes for LIKE
> queries (I just ran into this). See
> http://www.postgresql.org/docs/faqs/FAQ.html#4.8

No. It says that [normal] indexes won't be used for:

select foo from bar where col like '%abc';
or
select foo from bar where col like '%abc%';

or ILIKE is used. And even then you can use a functional index of the form

CREATE INDEX tabindex ON tab (lower(col));

> I suggest that the init-script be rewritten so that LANG and LC_ALL are
> unset before initdb is run (which happens the first time PostgreSQL is
> started after the RPM-based installation).

I'll admit that I don't know what effect this would have but I'm
interested to find out.

regards

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shachar Shemesh 2004-04-04 23:10:07 Version 1.0.0.4 released
Previous Message Troels Arvin 2004-04-04 20:48:12 RPM init-script: Why the locale setting?