Matt Magoffin [EMAIL PROTECTED] writes:
Should the xpath() function return 3 individual text nodes like this:
/[EMAIL PROTECTED]mykey]/text() = {
value1,
value2,
value3
}
rather than concatenating these into a single text node result?
AFAICT that's exactly what it does.
AFAICT that's exactly what it does.
regression=# select xpath('//[EMAIL PROTECTED]mykey]/text()',
'valueABCfoo
key=mykeyXYZ/foo/valuefoo key=mykeyRST/foofooDEF/foo');
xpath
---
{XYZ,RST}
(1 row)
regression=#
Of course this is of type xml[], but you can cast to text[] and
Matt Magoffin [EMAIL PROTECTED] writes:
Ugh, you're right of course! Somehow I had this wrong. So I tried to
create an index on the xml[] result by casting to text[] but I got the
function must be immutable error. Is there any reason the xml[] to
text[] cast is not immutable?
Hmm ... I see
Matt Magoffin [EMAIL PROTECTED] writes:
2) Even if I could have an xpath() result return an array with multiple
values, like {value1,value2,value3} I wasn't able to define a GIN index
against the xml[] type. Should this be possible?
Dunno about your other questions, but the answer to this one
Matt Magoffin [EMAIL PROTECTED] writes:
2) Even if I could have an xpath() result return an array with multiple
values, like {value1,value2,value3} I wasn't able to define a GIN index
against the xml[] type. Should this be possible?
Dunno about your other questions, but the answer to this
I've working with XML in Postgres 8.3 and am trying to find a way to
create a text-based index from an XPath that returns multiple nodes. For
example, if I have an XPath like
/[EMAIL PROTECTED]mykey]/text()
which might return a few text nodes like
value1
value2
value3
I'd like 3 index values