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