postgresql/contrib/postgres_fdw
Etsuro Fujita 82593b9a3d postgres_fdw: Disable batch insertion when there are WCO constraints.
When inserting a view referencing a foreign table that has WITH CHECK
OPTION constraints, in single-insert mode postgres_fdw retrieves the
data that was actually inserted on the remote side so that the WITH
CHECK OPTION constraints are enforced with the data locally, but in
batch-insert mode it cannot currently retrieve the data (except for the
row first inserted through the view), resulting in enforcing the WITH
CHECK OPTION constraints with the data passed from the core (except for
the first-inserted row), which led to incorrect results when inserting
into a view referencing a foreign table in which a remote BEFORE ROW
INSERT trigger changes the rows inserted through the view so that they
violate the view's WITH CHECK OPTION constraint.  Also, the query
inserting into the view caused an assertion failure in assert-enabled
builds.

Fix these by disabling batch insertion when inserting into such a view.

Back-patch to v14 where batch insertion was added.

Discussion: https://postgr.es/m/CAPmGK17LpbTZs4m4a_6THP54UBeK9fHvX8aVVA%2BC6yEZDZwQcg%40mail.gmail.com
2022-08-05 17:15:00 +09:00
..
expected postgres_fdw: Disable batch insertion when there are WCO constraints. 2022-08-05 17:15:00 +09:00
sql postgres_fdw: Disable batch insertion when there are WCO constraints. 2022-08-05 17:15:00 +09:00
.gitignore
connection.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
deparse.c postgres_fdw: be more wary about shippability of reg* constants. 2022-07-17 18:11:22 -04:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
option.c Tweak detail and hint messages to be consistent with project policy 2022-07-20 09:50:12 +09: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 postgres_fdw: Disable batch insertion when there are WCO constraints. 2022-08-05 17:15:00 +09: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 Fix postgres_fdw to check shippability of sort clauses properly. 2022-03-31 14:29:48 -04:00
shippable.c Update copyright for 2022 2022-01-07 19:04:57 -05:00