pgsql: Fix leaked hash scans in pg_listening_channels().
pgsql: Fix leaked hash scans in pg_listening_channels().
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Fix leaked hash scans in pg_listening_channels(). Commit 282b1cde9 changed pg_listening_channels() to keep a hash table scan open between calls of this set-returning function. If the executor stops fetching rows early, as with a target-list call under LIMIT, the scan remains registered until transaction end, resulting in leak complaints and eventually a PANIC. Instead materialize the result in a tuplestore, so that we can complete the hash scan within a single call. Author: Joel Jacobson Reviewed-by: Tom Lane Discussion: https://postgr.es/m/069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com Backpatch-through: 19 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2b491ff1cd2e23ac7a9f9efbd59ddd4aa02dbb58 Modified Files -------------- src/backend/commands/async.c | 56 ++++++++++++++----------------------- src/test/regress/expected/async.out | 7 +++++ src/test/regress/sql/async.sql | 4 +++ 3 files changed, 32 insertions(+), 35 deletions(-)