python-postgres / be

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

Throw an exception in the Stateful generator on completion #21

Open jwp opened 14 years ago

jwp commented 14 years ago

Currently, to achieve this, I think it would be necessary to create a custom, child MemoryContext in fn_mcxt; when that gets deleted or reset, throw the "Postgres.CallFinished" exception and clear the call references.

Primary question, is it safe to call the handler inside a MemoryContext delete/reset?