python-postgres / be

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

Implement Postgres.Call #11

Open jwp opened 14 years ago

jwp commented 14 years ago

Currently, direct function calls cannot leverage SRFs or functions that keep state.

An explicit Call object to manage that state is necessary. This is, essentially, objectified fcinfo.

jwp commented 14 years ago

Postgres.Call needs to have some intelligence in order to distinguish between SRFs and regular functions; this also has some impact on the supported interfaces:

SRFs will only support next Non-SRFs will support call()

VPC-SRFs will likely be the supported mode, and each call will need it's own MemoryContext.

Also, consider an optimization for SRFs that return a Call() like Postgres.Cursor() returns.