Re: Syntax problem with INDEX on expression

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Syntax problem with INDEX on expression
Date: 2013-04-05 21:18:30
Message-ID: 1365196710.77872.YahooMailNeo@web162902.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com> wrote:

> sp_dev=# create index test_idx on test ((xpath('//rms:xsid/text()',udh,array[array['rms','http://www.example.com']]))[1]::text);
> ERROR:  syntax error at or near "["
> LINE 1: ...udh,array[array['rms','http://www.example.com']]))[1]::text)...
>                                                              ^
> It looks like it doesn't like the array subscript.  What might I be missing?

You're missing a set of parentheses around the entire expression.

create index test_idx on test (((xpath('//rms:xsid/text()',udh,array[array['rms','http://www.example.com']]))[1]::text));

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Blackwell 2013-04-05 21:20:06 Re: Syntax problem with INDEX on expression
Previous Message Mike Blackwell 2013-04-05 21:03:36 Syntax problem with INDEX on expression