Re: issue with postgres/xml - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: issue with postgres/xml
Date
Msg-id 48C79B0E.5060908@gmx.net
Whole thread Raw
In response to issue with postgres/xml  (Cindy Moore <ctmoore@uci.edu>)
List pgsql-bugs
Cindy Moore wrote:
> I looked through the lists and couldn't figure out where else to put
> this.  I'm trying to create indices on xpath expressions for columns
> of type xml.
> I'm running postgres version 8.3.3, running on solaris.
>
> Text=# create index trclass on lsj_xml ((xpath
> ('//span[@class="tr"]/text()', entry)::text));
> ERROR:  functions in index expression must be marked IMMUTABLE

xpath returns an array.  I'm not sure offhand why the cast from array to
text is not immutable, but if you select an array element, it works:

create index trclass on lsj_xml (((xpath('//span[@class="tr"]/text()',
entry))[1]::text));

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4413: LEFT JOIN not working as expected
Next
From: "Rudolf Leitgeb"
Date:
Subject: BUG #4414: PQescapeByteaInternal very slow/inefficient