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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matt Magoffin" <postgresql(dot)org(at)msqr(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: possible to create multivalued index from xpath() results in 8.3?
Date: 2007-11-20 19:29:42
Message-ID: 12829.1195586982@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Matt Magoffin" <postgresql(dot)org(at)msqr(dot)us> writes:
> Should the xpath() function return 3 individual text nodes like this:

> /elem[(at)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[(at)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2007-11-20 21:16:26 PostgreSQL 8.3 Beta3 released!
Previous Message Vivek Khera 2007-11-20 19:14:22 Re: postgresql storage and performance questions

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-11-20 19:35:41 Re: Simplifying Text Search
Previous Message Bruce Momjian 2007-11-20 19:25:32 Re: Simplifying Text Search