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 <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/[email protected] 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(-)
