PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plpy_spi.h
Go to the documentation of this file.
1 /*
2  * src/pl/plpython/plpy_spi.h
3  */
4 
5 #ifndef PLPY_SPI_H
6 #define PLPY_SPI_H
7 
8 #include "utils/palloc.h"
9 #include "utils/resowner.h"
10 
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);
14 
15 typedef struct PLyExceptionEntry
16 {
17  int sqlstate; /* hash key, must be first */
18  PyObject *exc; /* corresponding exception */
20 
21 /* handling of SPI operations inside subtransactions */
22 extern void PLy_spi_subtransaction_begin(MemoryContext oldcontext, ResourceOwner oldowner);
23 extern void PLy_spi_subtransaction_commit(MemoryContext oldcontext, ResourceOwner oldowner);
24 extern void PLy_spi_subtransaction_abort(MemoryContext oldcontext, ResourceOwner oldowner);
25 
26 #endif /* PLPY_SPI_H */
PyObject * PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
Definition: plpy_spi.c:196
PyObject * PLy_spi_prepare(PyObject *self, PyObject *args)
Definition: plpy_spi.c:43
void PLy_spi_subtransaction_commit(MemoryContext oldcontext, ResourceOwner oldowner)
Definition: plpy_spi.c:512
PyObject * PLy_spi_execute(PyObject *self, PyObject *args)
Definition: plpy_spi.c:175
struct PLyExceptionEntry PLyExceptionEntry
tuple list
Definition: sort-test.py:11
void PLy_spi_subtransaction_abort(MemoryContext oldcontext, ResourceOwner oldowner)
Definition: plpy_spi.c:521
PyObject * exc
Definition: plpy_spi.h:18
void PLy_spi_subtransaction_begin(MemoryContext oldcontext, ResourceOwner oldowner)
Definition: plpy_spi.c:504