X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 02453D1B2A6 for ; Thu, 22 Jul 2004 20:46:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13360-03 for ; Thu, 22 Jul 2004 23:46:33 +0000 (GMT) Received: from mail2.smarthost.net.au (unknown [203.63.194.30]) by svr1.postgresql.org (Postfix) with ESMTP id ED76DD1B262 for ; Thu, 22 Jul 2004 20:46:29 -0300 (ADT) Received: from PHOENIX (unknown [10.0.0.81]) by mail2.smarthost.net.au (Postfix) with SMTP id 97786114033; Fri, 23 Jul 2004 09:43:42 +1000 (EST) Message-ID: <002a01c47046$1b31b2c0$5100000a@PHOENIX> From: "Chris Cox" To: "Peter Eisentraut" Cc: References: <030e01c46fbe$e8baeb90$5100000a@PHOENIX> <200407221441.05497.peter_e@gmx.net> Subject: Re: LIKE on index not working Date: Fri, 23 Jul 2004 09:46:27 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/191 X-Sequence-Number: 18443 Hi Peter, Thanks for the tip. The locale we're using is en_US.UTF-8. From my limited knowledge of locales, that's a non-C one isn't it? Am I right in saying that to fix it I need to initdb again with a C locale? How do I go about doing that on an environment with some 132 databases? What a pain! Chris ----- Original Message ----- From: "Peter Eisentraut" To: "Chris Cox" Cc: Sent: Thursday, July 22, 2004 10:41 PM Subject: Re: [SQL] LIKE on index not working > Am Donnerstag, 22. Juli 2004 09:38 schrieb Chris Cox: > > For some reason I just can't get this to use the index for the following > > query. I'm using PostgreSQL 7.3.4. > > In 7.3, LIKE cannot use an index unless you set the locale to C. In 7.4, LIKE > can use an index, but it has to be a different kind of index, as explained > here: > > http://www.postgresql.org/docs/7.4/static/indexes-opclass.html > > -- > Peter Eisentraut > http://developer.postgresql.org/~petere/ >