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