|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <limits.h>#include "access/xact.h"#include "catalog/pg_type.h"#include "executor/spi.h"#include "mb/pg_wchar.h"#include "parser/parse_type.h"#include "plpy_elog.h"#include "plpy_main.h"#include "plpy_planobject.h"#include "plpy_plpymodule.h"#include "plpy_resultobject.h"#include "plpy_spi.h"#include "plpy_util.h"#include "utils/memutils.h"
Go to the source code of this file.
Functions | |
| static PyObject * | PLy_spi_execute_query (char *query, long limit) |
| static PyObject * | PLy_spi_execute_fetch_result (SPITupleTable *tuptable, uint64 rows, int status) |
| static void | PLy_spi_exception_set (PyObject *excclass, ErrorData *edata) |
| PyObject * | PLy_spi_prepare (PyObject *self, PyObject *args) |
| PyObject * | PLy_spi_execute (PyObject *self, PyObject *args) |
| PyObject * | PLy_spi_execute_plan (PyObject *ob, PyObject *list, long limit) |
| PyObject * | PLy_commit (PyObject *self, PyObject *args) |
| PyObject * | PLy_rollback (PyObject *self, PyObject *args) |
| void | PLy_spi_subtransaction_begin (MemoryContext oldcontext, ResourceOwner oldowner) |
| void | PLy_spi_subtransaction_commit (MemoryContext oldcontext, ResourceOwner oldowner) |
| void | PLy_spi_subtransaction_abort (MemoryContext oldcontext, ResourceOwner oldowner) |
Definition at line 446 of file plpy_spi.c.
References CopyErrorData(), CurrentMemoryContext, PLyExceptionEntry::exc, fb(), FlushErrorState(), FreeErrorData(), HASH_FIND, hash_search(), MemoryContextSwitchTo(), PG_CATCH, PG_END_TRY, PG_TRY, PLy_current_execution_context(), PLy_exc_spi_error, PLy_spi_exception_set(), PLy_spi_exceptions, and SPI_commit().
Definition at line 493 of file plpy_spi.c.
References CopyErrorData(), CurrentMemoryContext, PLyExceptionEntry::exc, fb(), FlushErrorState(), FreeErrorData(), HASH_FIND, hash_search(), MemoryContextSwitchTo(), PG_CATCH, PG_END_TRY, PG_TRY, PLy_current_execution_context(), PLy_exc_spi_error, PLy_spi_exception_set(), PLy_spi_exceptions, and SPI_rollback().
Definition at line 617 of file plpy_spi.c.
References elog, ERROR, and fb().
Referenced by PLy_commit(), PLy_rollback(), and PLy_spi_subtransaction_abort().
Definition at line 150 of file plpy_spi.c.
References fb(), is_PLyPlanObject(), plan, PLy_exc_error, PLy_exception_set(), PLy_spi_execute_plan(), and PLy_spi_execute_query().
|
static |
Definition at line 336 of file plpy_spi.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CreateTupleDescCopy(), CurrentMemoryContext, ereport, errcode(), errmsg(), ERROR, fb(), i, MemoryContextDelete(), MemoryContextSwitchTo(), PLyResultObject::nrows, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PLy_current_execution_context(), PLy_input_from_tuple(), PLy_input_setup_func(), PLy_input_setup_tuple(), PLy_result_new(), PLyResultObject::rows, SPI_freetuptable(), PLyResultObject::status, TopMemoryContext, SPITupleTable::tupdesc, PLyResultObject::tupdesc, and SPITupleTable::vals.
Referenced by PLy_spi_execute_plan(), and PLy_spi_execute_query().
Definition at line 171 of file plpy_spi.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, arg, CurrentMemoryContext, CurrentResourceOwner, CurTransactionContext, ERROR, fb(), j, MemoryContextDelete(), MemoryContextSwitchTo(), palloc(), PG_CATCH, PG_END_TRY, PG_FINALLY, PG_TRY, plan, PLy_current_execution_context(), PLy_elog, PLy_exc_spi_error, PLy_exception_set(), PLy_exception_set_plural(), PLy_output_convert(), PLy_spi_execute_fetch_result(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), PLyUnicode_AsString(), SPI_execute_plan(), SPI_processed, SPI_result_code_string(), SPI_tuptable, and values.
Referenced by PLy_plan_execute(), and PLy_spi_execute().
Definition at line 294 of file plpy_spi.c.
References CurrentMemoryContext, CurrentResourceOwner, fb(), PG_CATCH, PG_END_TRY, PG_TRY, pg_verifymbstr(), PLy_current_execution_context(), PLy_exc_spi_error, PLy_exception_set(), PLy_spi_execute_fetch_result(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), SPI_execute(), SPI_processed, SPI_result_code_string(), and SPI_tuptable.
Referenced by PLy_spi_execute().
Definition at line 36 of file plpy_spi.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, CurrentMemoryContext, CurrentResourceOwner, elog, ereport, errmsg(), ERROR, fb(), i, MemoryContextSwitchTo(), palloc0_array, parseTypeString(), PG_CATCH, PG_END_TRY, PG_TRY, pg_verifymbstr(), plan, PLy_current_execution_context(), PLy_exception_set(), PLy_output_setup_func(), PLy_plan_new(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), PLyUnicode_AsString(), SPI_keepplan(), SPI_prepare(), SPI_result, SPI_result_code_string(), and TopMemoryContext.
| void PLy_spi_subtransaction_abort | ( | MemoryContext | oldcontext, |
| ResourceOwner | oldowner | ||
| ) |
Definition at line 582 of file plpy_spi.c.
References CopyErrorData(), CurrentResourceOwner, PLyExceptionEntry::exc, fb(), FlushErrorState(), FreeErrorData(), HASH_FIND, hash_search(), MemoryContextSwitchTo(), PLy_exc_spi_error, PLy_spi_exception_set(), PLy_spi_exceptions, and RollbackAndReleaseCurrentSubTransaction().
Referenced by PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_spi_execute_plan(), PLy_spi_execute_query(), and PLy_spi_prepare().
| void PLy_spi_subtransaction_begin | ( | MemoryContext | oldcontext, |
| ResourceOwner | oldowner | ||
| ) |
Definition at line 565 of file plpy_spi.c.
References BeginInternalSubTransaction(), fb(), and MemoryContextSwitchTo().
Referenced by PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_spi_execute_plan(), PLy_spi_execute_query(), and PLy_spi_prepare().
| void PLy_spi_subtransaction_commit | ( | MemoryContext | oldcontext, |
| ResourceOwner | oldowner | ||
| ) |
Definition at line 573 of file plpy_spi.c.
References CurrentResourceOwner, MemoryContextSwitchTo(), and ReleaseCurrentSubTransaction().
Referenced by PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_spi_execute_plan(), PLy_spi_execute_query(), and PLy_spi_prepare().