postgresql/contrib/postgres_fdw
Michael Paquier 806fad7573 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:19 +09:00
..
expected Fix buffer refcount leak with FDW bulk inserts 2023-04-25 09:42:19 +09:00
sql Fix buffer refcount leak with FDW bulk inserts 2023-04-25 09:42:19 +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 Fix various typos 2023-04-18 13:23:23 +12:00
deparse.c Fix various typos in code and tests 2023-02-09 14:43:53 +09:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
option.c De-Revert "Add support for Kerberos credential delegation" 2023-04-13 08:55:07 -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 Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Fix various typos 2023-04-18 13:23:23 +12: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 Check relkind before using TABLESAMPLE in postgres_fdw 2023-01-07 14:39:33 +01:00
shippable.c Remove useless casts to (void *) in hash_search() calls 2023-02-06 09:41:01 +01:00