postgres_fdw: Disable batch insert when BEFORE ROW INSERT triggers exist.
authorEtsuro Fujita <efujita@postgresql.org>
Thu, 21 Apr 2022 06:30:00 +0000 (15:30 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Thu, 21 Apr 2022 06:30:00 +0000 (15:30 +0900)
commit4eea2202beadbba67638bb129149abe5650aaaf6
tree734aff3b848b6f83d6da7d75276f96464d2ee630
parentba6af6aa0b764d76cfca79d9dfbddc7134a16bfc
postgres_fdw: Disable batch insert when BEFORE ROW INSERT triggers exist.

Previously, we allowed this, but such triggers might query the table to
insert into and act differently if the tuples that have already been
processed and prepared for insertion are not there, so disable it in
such cases.

Back-patch to v14 where batch insert was added.

Discussion: https://postgr.es/m/CAPmGK16_uPqsmgK0-LpLSUk54_BoK13bPrhxhfjSoSTVz414hA%40mail.gmail.com
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/postgres_fdw.c
contrib/postgres_fdw/sql/postgres_fdw.sql