Re: any way to make query use index?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Hoover" <revoohc(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: any way to make query use index?
Date: 2007-11-15 16:52:05
Message-ID: 4199.1195145525@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Chris Hoover" <revoohc(at)gmail(dot)com> writes:
> On Nov 15, 2007 11:25 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2007-11-15 17:14:46 Re: help to Brazil
Previous Message Tom Lane 2007-11-15 16:49:44 Re: Error: duplicate key violates unique constraint - "pg_toast_3270368541_index