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));