Re: Syntax problem with INDEX on expression - Mailing list pgsql-general

From Kevin Grittner
Subject Re: Syntax problem with INDEX on expression
Date
Msg-id 1365196710.77872.YahooMailNeo@web162902.mail.bf1.yahoo.com
Whole thread Raw
In response to Syntax problem with INDEX on expression  (Mike Blackwell <mike.blackwell@rrd.com>)
Responses Re: Syntax problem with INDEX on expression
List pgsql-general
Mike Blackwell <mike.blackwell@rrd.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


pgsql-general by date:

Previous
From: Mike Blackwell
Date:
Subject: Syntax problem with INDEX on expression
Next
From: Mike Blackwell
Date:
Subject: Re: Syntax problem with INDEX on expression