"Catalin Pitis" <cpitis.pgsql@gmail.com> writes:
> ERROR: plan should not reference subplan's variable
> Do you have any clue why does this happen?
It's a bug :-(. Thanks for the test case --- I'll look into it tonight
or tomorrow, if no one beats me to it.
regards, tom lane