Re: LATERAL, UNNEST and spec compliance
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: David Fetter <david@fetter.org>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2013-01-25T20:26:56Z
Lists: pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> SELECT ... FROM a WHERE a.x IN (SELECT ... FROM b, srf(y) WHERE ...) > Actually, this appears to fail already, at least in 9.2.2: > => select * from (values (1)) v(a) where v.a in (select x from (values (2)) v2(a), > -> generate_series(1,a) x); > ERROR: function expression in FROM cannot refer to other relations of same query level > LINE 2: generate_series(1,a) x); > ^ Huh ... you're right, I'd forgotten about that. That's an ancient bug that got fixed in passing in the LATERAL work. So, as long as we're not going to fix that bug in the back branches (which would be difficult anyway IIRC), we don't have a compatibility problem ... regards, tom lane