Search Postgresql Archives

Re: possible to create multivalued index from xpath() results in 8.3?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Matt Magoffin" <postgresql.org@xxxxxxx> writes:
> Should the xpath() function return 3 individual text nodes like this:

> /elem[@key="mykey"]/text() => {
>   value1,
>   value2,
>   value3
> }

> rather than concatenating these into a single text node result?

AFAICT that's exactly what it does.

regression=#  select xpath('//foo[@key="mykey"]/text()', '<value>ABC<foo key="mykey">XYZ</foo></value><foo key="mykey">RST</foo><foo>DEF</foo>');
   xpath   
-----------
 {XYZ,RST}
(1 row)

regression=# 

Of course this is of type xml[], but you can cast to text[] and then
index.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux