Re: Index creation question for expression (col1 || '-' || col2)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ying Lu <ying_lu(at)cs(dot)concordia(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Index creation question for expression (col1 || '-' || col2)
Date: 2005-07-08 16:15:04
Message-ID: 23332.1120839304@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Ying Lu <ying_lu(at)cs(dot)concordia(dot)ca> writes:
> A question about creating index for the following expression.

> CREATE INDEX idx_t1 ON test (col1 || '-' || col2);

You need more parentheses:

CREATE INDEX idx_t1 ON test ((col1 || '-' || col2));

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-07-08 16:32:15 Re: Index creation question for expression (col1 || '-' || col2)
Previous Message Tom Lane 2005-07-08 16:12:23 Re: Make COUNT(*) Faster?