postgresql/contrib/postgres_fdw
Michael Paquier 4cc56f8edb Fix buffer refcount leak with FDW bulk inserts
The leak would show up when using batch inserts with foreign tables
included in a partition tree, as the slots used in the batch were not
reset once processed.  In order to fix this problem, some
ExecClearTuple() are added to clean up the slots used once a batch is
filled and processed, mapping with the number of slots currently in use
as tracked by the counter ri_NumSlots.

This buffer refcount leak has been introduced in b676ac4 with the
addition of the executor facility to improve bulk inserts for FDWs, so
backpatch down to 14.

Alexander has provided the patch (slightly modified by me).  The test
for postgres_fdw comes from me, based on the test case that the author
has sent in the report.

Author: Alexander Pyhalov
Discussion: https://postgr.es/m/b035780a740efd38dc30790c76927255@postgrespro.ru
Backpatch-through: 14
2023-04-25 09:42:36 +09:00
..
expected Fix buffer refcount leak with FDW bulk inserts 2023-04-25 09:42:36 +09:00
sql Fix buffer refcount leak with FDW bulk inserts 2023-04-25 09:42:36 +09:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
connection.c postgres_fdw: Fix subabort cleanup of connections used in asynchronous execution. 2022-01-21 17:45:02 +09:00
deparse.c Fix postgres_fdw to check shippability of sort clauses properly. 2022-03-31 14:29:24 -04:00
option.c Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:21:35 +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 Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05: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:24 -04:00
shippable.c Replace remaining uses of "whitelist". 2021-01-05 14:00:16 +13:00