PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 "plpython.h"
9#include "utils/resowner.h"
10
11extern PyObject *PLy_spi_prepare(PyObject *self, PyObject *args);
12extern PyObject *PLy_spi_execute(PyObject *self, PyObject *args);
13extern PyObject *PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit);
14
15extern PyObject *PLy_commit(PyObject *self, PyObject *args);
16extern PyObject *PLy_rollback(PyObject *self, PyObject *args);
17
18typedef struct PLyExceptionEntry
19{
20 int sqlstate; /* hash key, must be first */
21 PyObject *exc; /* corresponding exception */
23
24/* handling of SPI operations inside subtransactions */
25extern void PLy_spi_subtransaction_begin(MemoryContext oldcontext, ResourceOwner oldowner);
26extern void PLy_spi_subtransaction_commit(MemoryContext oldcontext, ResourceOwner oldowner);
27extern void PLy_spi_subtransaction_abort(MemoryContext oldcontext, ResourceOwner oldowner);
28
29#endif /* PLPY_SPI_H */
void PLy_spi_subtransaction_commit(MemoryContext oldcontext, ResourceOwner oldowner)
Definition: plpy_spi.c:573
PyObject * PLy_spi_prepare(PyObject *self, PyObject *args)
Definition: plpy_spi.c:36
struct PLyExceptionEntry PLyExceptionEntry
PyObject * PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
Definition: plpy_spi.c:171
PyObject * PLy_commit(PyObject *self, PyObject *args)
Definition: plpy_spi.c:446
PyObject * PLy_rollback(PyObject *self, PyObject *args)
Definition: plpy_spi.c:493
PyObject * PLy_spi_execute(PyObject *self, PyObject *args)
Definition: plpy_spi.c:150
void PLy_spi_subtransaction_abort(MemoryContext oldcontext, ResourceOwner oldowner)
Definition: plpy_spi.c:582
void PLy_spi_subtransaction_begin(MemoryContext oldcontext, ResourceOwner oldowner)
Definition: plpy_spi.c:565
PyObject * exc
Definition: plpy_spi.h:21