Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 961632E2D73 for ; Thu, 15 Nov 2007 12:52:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 23938-06 for ; Thu, 15 Nov 2007 12:52:08 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id F121B2E2B56 for ; Thu, 15 Nov 2007 12:52:07 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lAFGq5vA004200; Thu, 15 Nov 2007 11:52:05 -0500 (EST) To: "Chris Hoover" cc: "pgsql-admin@postgresql.org Admin" Subject: Re: any way to make query use index? In-reply-to: <1d219a6f0711150837i26f35caek3d80fe4a569f6ebb@mail.gmail.com> References: <1d219a6f0711150714j6f192548xe4c134a25e5b57b2@mail.gmail.com> <3669.1195143924@sss.pgh.pa.us> <1d219a6f0711150837i26f35caek3d80fe4a569f6ebb@mail.gmail.com> Comments: In-reply-to "Chris Hoover" message dated "Thu, 15 Nov 2007 11:37:49 -0500" Date: Thu, 15 Nov 2007 11:52:05 -0500 Message-ID: <4199.1195145525@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/152 X-Sequence-Number: 27395 "Chris Hoover" writes: > On Nov 15, 2007 11:25 AM, Tom Lane wrote: >> If changing the queries seems impractical, you could add an index on >> rev_code::text, or reconsider the choice of column type. > how would you create this index? create index rev_code_text_idx on > rev_code_desc(rev_code::text) fails complaining "ERROR: syntax error > at or near "::"" You need more parentheses --- read the docs about expression indexes. regards, tom lane