mirror of
https://github.com/postgres/postgres.git
synced 2026-04-29 18:32:53 -04:00
This moves the code around from one huge file into hopefully logical and more manageable modules. For the most part, the code itself was not touched, except: PLy_function_handler and PLy_trigger_handler were renamed to PLy_exec_function and PLy_exec_trigger, because they were not actually handlers in the PL handler sense, and it makes the naming more similar to the way PL/pgSQL is organized. The initialization of the procedure caches was separated into a new function init_procedure_caches to keep the hash tables private to plpy_procedures.c. Jan Urbański and Peter Eisentraut
25 lines
762 B
C
25 lines
762 B
C
/*
|
|
* 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 */
|