diff options
Diffstat (limited to 'src/pl/plpython/plpy_spi.h')
-rw-r--r-- | src/pl/plpython/plpy_spi.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pl/plpython/plpy_spi.h b/src/pl/plpython/plpy_spi.h new file mode 100644 index 00000000000..c59482a3f0f --- /dev/null +++ b/src/pl/plpython/plpy_spi.h @@ -0,0 +1,25 @@ +/* + * src/pl/plpython/plpy_spi.h + */ + +#ifndef PLPY_SPI_H +#define PLPY_SPI_H + +#include "utils/palloc.h" +#include "utils/resowner.h" + +extern PyObject *PLy_spi_prepare(PyObject *, PyObject *); +extern PyObject *PLy_spi_execute(PyObject *, PyObject *); + +typedef struct PLyExceptionEntry +{ + int sqlstate; /* hash key, must be first */ + PyObject *exc; /* corresponding exception */ +} PLyExceptionEntry; + +/* handling of SPI operations inside subtransactions */ +extern void PLy_spi_subtransaction_begin(MemoryContext oldcontext, ResourceOwner oldowner); +extern void PLy_spi_subtransaction_commit(MemoryContext oldcontext, ResourceOwner oldowner); +extern void PLy_spi_subtransaction_abort(MemoryContext oldcontext, ResourceOwner oldowner); + +#endif /* PLPY_SPI_H */ |