Pull up ANY-SUBLINK with the necessary lateral support.
authorAlexander Korotkov
Thu, 15 Feb 2024 10:05:52 +0000 (12:05 +0200)
committerAlexander Korotkov
Thu, 15 Feb 2024 10:06:12 +0000 (12:06 +0200)
commit9f133763961e280d8ba692bcad0b061b861e9138
treeaf76ca54ac251b87aefae347d586e6b300df3c8e
parent995d400ceca3e552f84fe19f150fb03327bdc0c2
Pull up ANY-SUBLINK with the necessary lateral support.

For ANY-SUBLINK, we adopted a two-stage pull-up approach to handle
different types of scenarios. In the first stage, the sublink is pulled up
as a subquery. Because of this, when writing this code, we did not have
the ability to perform lateral joins, and therefore, we were unable to
pull up Var with varlevelsup=1. Now that we have the ability to use
lateral joins, we can eliminate this limitation.

Author: Andy Fan 
Author: Tom Lane 
Reviewed-by: Tom Lane
Reviewed-by: Richard Guo
Reviewed-by: Alena Rybakina
Reviewed-by: Andrey Lepikhov
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/sql/postgres_fdw.sql
src/backend/optimizer/plan/subselect.c
src/test/regress/expected/join.out
src/test/regress/expected/subselect.out
src/test/regress/sql/join.sql
src/test/regress/sql/subselect.sql