Daniel Grace <dgrace(at)wingsnw(dot)com> writes:
> The following nonsensical query causes PostgreSQL to fail with ERROR: plan
> should not reference subplan's variable. (This was stripped down from an
> 'useful' query that triggered the same bug). First encountered on 8.3.4,
> reproduced on 8.3.7
Patch is here:
http://archives.postgresql.org/pgsql-committers/2009-04/msg00277.php
I still think that it won't affect you once you have the query logic
straight, though.
regards, tom lane