Re: xpath() subquery for empty array - Mailing list pgsql-general

From Roy Walter
Subject Re: xpath() subquery for empty array
Date
Msg-id 4A5A574F.3030508@brookhouse.co.uk
Whole thread Raw
In response to Re: xpath() subquery for empty array  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
Sam Mason wrote:
On Sun, Jul 12, 2009 at 09:49:15PM +0100, Roy Walter wrote: 
Where exactly does that fit in terms of my original query, i.e.:
  SELECT x  FROM (SELECT xpath('//entry[contains(p, ''searchtext'')]/@*', docxml)  AS x FROM docs) AS y WHERE x <> [test for empty array?????????]   
Something like the following should do the right thing:
 SELECT x FROM (   SELECT xpath('//entry[contains(p, ''searchtext'')]/@*', docxml) AS x   FROM docs) AS y WHERE array_upper(x, 1) > 0; 
Thank you, works just fine. I thought it was more complicated than that :-)

-- Roy

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: xpath() subquery for empty array
Next
From: Dennis Gearon
Date:
Subject: Re: indexes on float8 vs integer