Re: functions returning sets - Mailing list pgsql-general

From Tom Lane
Subject Re: functions returning sets
Date
Msg-id 14408.1071518342@sss.pgh.pa.us
Whole thread Raw
In response to functions returning sets  (Jeff Rogers <jrogers@findlaw.com>)
Responses Re: functions returning sets
List pgsql-general
Jeff Rogers <jrogers@findlaw.com> writes:
> However, the documentation says that using a SRF in the select list of
> a query, but this capability is deprecated.  I can't figure out how to
> call this function in the from clause with it referring to a column in
> a table, I get an error like
> ERROR:  FROM function expression may not refer to other relations of same
> query level.  Is there another way to accomplish this?

There isn't any good alternative at the moment (which is why SRFs in
select lists aren't deprecated yet).  There has been some discussion
about implementing SQL99's LATERAL clause to support this, but it's
not done yet.

> select file from xml_files where 'foo' in (select pgxml_xpath(doc,'/top/node'))
> parses, but it doesn't seem to give correct results.

That should work as far as I know.  Can you give more detail?

            regards, tom lane

pgsql-general by date:

Previous
From: Jenny Zhang
Date:
Subject: deadlock detected when inserting data
Next
From: Tom Lane
Date:
Subject: Re: Changing user