Fix header inclusion order in c.h.
[pgsql.git] / src / pl / plpython / plpy_spi.h
blob98ccd210931bf4868d4b61c9453c28ca85c1616c
1 /*
2 * src/pl/plpython/plpy_spi.h
3 */
5 #ifndef PLPY_SPI_H
6 #define PLPY_SPI_H
8 #include "plpython.h"
9 #include "utils/resowner.h"
11 extern PyObject *PLy_spi_prepare(PyObject *self, PyObject *args);
12 extern PyObject *PLy_spi_execute(PyObject *self, PyObject *args);
13 extern PyObject *PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit);
15 extern PyObject *PLy_commit(PyObject *self, PyObject *args);
16 extern PyObject *PLy_rollback(PyObject *self, PyObject *args);
18 typedef struct PLyExceptionEntry
20 int sqlstate; /* hash key, must be first */
21 PyObject *exc; /* corresponding exception */
22 } PLyExceptionEntry;
24 /* handling of SPI operations inside subtransactions */
25 extern void PLy_spi_subtransaction_begin(MemoryContext oldcontext, ResourceOwner oldowner);
26 extern void PLy_spi_subtransaction_commit(MemoryContext oldcontext, ResourceOwner oldowner);
27 extern void PLy_spi_subtransaction_abort(MemoryContext oldcontext, ResourceOwner oldowner);
29 #endif /* PLPY_SPI_H */