On 2018-Aug-16, Peter Eisentraut wrote: > There are, technically, three ways to fix this: silence the warning, > unregister the snapshot explicitly, or don't register the snapshot to > begin with. > > Silencing the warning, other than by just deleting it, might require > passing in some more context information into ResourceOwnerRelease(). > (The existing isTopLevel isn't quite the right thing.) > > Unregistering the snapshot explicitly looks tricky because in > SPI_commit() or thereabouts we have no context information about which > snapshot might have been registered where.
Hmm, this got me thinking whether the current resource owner setup for a procedure is appropriate. Maybe the problem is that resowners are still thought of in terms of transactions plus portals, so that if transactions are done then everything is over; maybe we need to teach them that procedures can outlive transactions, so you'd have a resowner that's global to the procedure and then each transaction resowner is a child of that one? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services