On 8/8/26 22:46, Bharath Rupireddy wrote: > Hi, > > On Sat, Aug 8, 2026 at 8:33 PM Bryan Green <[email protected]> wrote: >> >> A SQL slot function that errors after acquiring MyReplicationSlot leaks the >> slot when the error is caught by a PL/pgSQL EXCEPTION handler: the >> subtransaction aborts without releasing it, MyReplicationSlot stays set, and >> the next slot operation in the session trips Assert(!MyReplicationSlot). >> >> Releasing on error is done at the top level, in PostgresMain(), and the >> comment there is explicit that AbortTransaction() must not do it: > > Thanks. This issue is being discussed in this thread: > https://www.postgresql.org/message-id/CALj2ACU-mVxrak_Q0EP1sZg8h%3D7pg1d09Gj6Ody5jH6zxiZQLA%40mail.gmail.com. > Apologies for missing this. I will catch up on this thread! Thanks for bringing it to my attention!
-- Bryan Green EDB: https://www.enterprisedb.com
