On Thu, Apr 20, 2017 at 3:17 PM, jonathan vanasco <postg...@2xlp.com> wrote:

> postgres doesn't raise an error because example_a__data does have a bar_id
> -- but example_a__rollup doesn't and there's no explicit correlation in the
> query.
>
>
​Subqueries can see all columns of the parent.  When the subquery actually
uses one of them it is called a "correlated subquery".

See another recent question on this topic for more details:

https://www.postgresql.org/message-id/20160714135233.1410.92538%40wrigleys.postgresql.org

Unfortunately at present everyone here seems content answering this on the
list semi-frequently instead of updating the docs and/or FAQ section of our
wiki.  The topic is covered (I think...) but not easily found (I failed to
just now...) - and harder when you don't know what to call it in the first
place.

David J.

Reply via email to