python-postgres / be

pg-python: Execute Python 3 code from PostgreSQL functions.
Other
5 stars 2 forks source link

fn_extra free/memory context delete callback #10

Closed jwp closed 14 years ago

jwp commented 14 years ago

Currently, fn_extra/fi_state is held until the end of the transaction. For @Stateful this is effectively a leak for long running transactions.

Some way to finalize these resources would be good.

jwp commented 14 years ago

I think this may not be as useful as I once hoped. I don't know what the state of the backend is when a given context is deleted or reset, so I seems like it might be unsafe to DECREF the fn_extra objects. Given that the objects could run arbitrary code.