Re: functions returning sets

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Rogers <jrogers(at)findlaw(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: functions returning sets
Date: 2003-12-15 19:59:02
Message-ID: 14408.1071518342@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Rogers <jrogers(at)findlaw(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-12-15 20:07:21 Re: Changing user
Previous Message Jenny Zhang 2003-12-15 19:52:11 deadlock detected when inserting data