Re: Memory leak in plpython3u (with testcase and patch)

2025-01-10 Thread Tom Lane
I wrote: > However, I don't really see why we need to use that scratch context. > PLy_spi_execute_plan runs a subtransaction, so we could perfectly well > use the subtransaction's CurTransactionContext. Nah, I'm wrong about that: I forgot CurTransactionContext goes away on subtransaction abort, bu

Re: Memory leak in plpython3u (with testcase and patch)

2025-01-10 Thread Tom Lane
Mat Arye writes: > I found a memory leak in plpython3u. It happens when converting the > argument for an spi plan execution (via plpy.execute() or similar). I've > attached a sql file to create two plpython3u functions to reproduce the > issue (memory_leak_test.sql). I see the leak all right, and

Memory leak in plpython3u (with testcase and patch)

2025-01-10 Thread Mat Arye
Hi all, I found a memory leak in plpython3u. It happens when converting the argument for an spi plan execution (via plpy.execute() or similar). I've attached a sql file to create two plpython3u functions to reproduce the issue (memory_leak_test.sql). When running ``` set client_min_messages = 'de