Re: Controlling locale and impact on LIKE statements

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Martin Langhoff <martin(dot)langhoff(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Controlling locale and impact on LIKE statements
Date: 2007-09-05 02:23:43
Message-ID: 20070905022342.GF23731@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martin Langhoff escribió:

> As I have a Pg install where the locale is already en_US.UTF-8, and
> the database already exists, is there a DB-scoped way of controlling
> the locale?

Not really.

> Is there a better way? In this specific install I can create the
> additional index. However, this needs a general fix for Moodle, which
> has an abstract DB schema handling (we support MySQL, Pg, MSSQL,
> Oracle) and the whole thing of figuring out what the locale is and
> whether to add magical additional indexes just for Pg makes me look
> like a loony.

You are right and Eloy is wrong on that discussion. There is not
anything the DB can do to use the regular index if the locale is not C
for LIKE queries. There are good reasons for this. There's not much
option beyond creating the pattern_ops index.

--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"Most hackers will be perfectly comfortable conceptualizing users as entropy
sources, so let's move on." (Nathaniel Smith)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2007-09-05 02:33:41 Re: Documentation fix regarding atan2
Previous Message Martin Langhoff 2007-09-05 00:48:19 Controlling locale and impact on LIKE statements