pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: postgres_fdw: Disable batch insertion when there are WCO constra
3+ messages / 1 participants
[nested] [flat]

* pgsql: postgres_fdw: Disable batch insertion when there are WCO constra
@ 2022-08-05 08:28  Etsuro Fujita <efujita@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Etsuro Fujita @ 2022-08-05 08:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4a9bc2e0f5226d29e7e11c9611b8649a4aa74a4b

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 44 ++++++++++++++++++++++++++
contrib/postgres_fdw/postgres_fdw.c            |  6 ++--
contrib/postgres_fdw/sql/postgres_fdw.sql      | 16 ++++++++++
3 files changed, 64 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: postgres_fdw: Disable batch insertion when there are WCO constra
@ 2022-08-05 08:28  Etsuro Fujita <efujita@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Etsuro Fujita @ 2022-08-05 08:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/82593b9a3d5f1c58157f6e8fd7d69ef0d6f6eeb3

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 44 ++++++++++++++++++++++++++
contrib/postgres_fdw/postgres_fdw.c            |  6 ++--
contrib/postgres_fdw/sql/postgres_fdw.sql      | 16 ++++++++++
3 files changed, 64 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: postgres_fdw: Disable batch insertion when there are WCO constra
@ 2022-08-05 08:28  Etsuro Fujita <efujita@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Etsuro Fujita @ 2022-08-05 08:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1d49db259884a4e5579e63c05f1743608caa97b5

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 44 ++++++++++++++++++++++++++
contrib/postgres_fdw/postgres_fdw.c            |  6 ++--
contrib/postgres_fdw/sql/postgres_fdw.sql      | 16 ++++++++++
3 files changed, 64 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-08-05 08:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 08:28 pgsql: postgres_fdw: Disable batch insertion when there are WCO constra Etsuro Fujita <efujita@postgresql.org>
2022-08-05 08:28 pgsql: postgres_fdw: Disable batch insertion when there are WCO constra Etsuro Fujita <efujita@postgresql.org>
2022-08-05 08:28 pgsql: postgres_fdw: Disable batch insertion when there are WCO constra Etsuro Fujita <efujita@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox