postgresql/contrib/postgres_fdw
Alexander Korotkov 824dbea3e4 Add support for deparsing semi-joins to contrib/postgres_fdw
SEMI-JOIN is deparsed as the EXISTS subquery. It references outer and inner
relations, so it should be evaluated as the condition in the upper-level WHERE
clause. The signatures of deparseFromExprForRel() and deparseRangeTblRef() are
revised so that they can add conditions to the upper level.

PgFdwRelationInfo now has a hidden_subquery_rels field, referencing the relids
used in the inner parts of semi-join.  They can't be referred to from upper
relations and should be used internally for equivalence member searches.

The planner can create semi-join, which refers to inner rel vars in its target
list. However, we deparse semi-join as an exists() subquery. So we skip the
case when the target list references to inner rel of semi-join.

Author: Alexander Pyhalov
Reviewed-by: Ashutosh Bapat, Ian Lawrence Barwick, Yuuki Fujii, Tomas Vondra
Discussion: https://postgr.es/m/c9e2a757cf3ac2333714eaf83a9cc184@postgrespro.ru
2023-12-05 22:53:12 +02:00
..
expected Add support for deparsing semi-joins to contrib/postgres_fdw 2023-12-05 22:53:12 +02:00
sql Add support for deparsing semi-joins to contrib/postgres_fdw 2023-12-05 22:53:12 +02:00
.gitignore
connection.c postgres_fdw: Replace WAIT_EVENT_EXTENSION with custom wait events 2023-10-05 09:50:42 +09:00
deparse.c Add support for deparsing semi-joins to contrib/postgres_fdw 2023-12-05 22:53:12 +02:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
option.c Expand some more uses of "deleg" to "delegation" or "delegated". 2023-05-21 10:55:18 -04:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql
postgres_fdw.c Add support for deparsing semi-joins to contrib/postgres_fdw 2023-12-05 22:53:12 +02:00
postgres_fdw.control postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
postgres_fdw.h Add support for deparsing semi-joins to contrib/postgres_fdw 2023-12-05 22:53:12 +02:00
shippable.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00