PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <limits.h>
#include "catalog/pg_type.h"
#include "mb/pg_wchar.h"
#include "plpy_cursorobject.h"
#include "plpy_elog.h"
#include "plpy_main.h"
#include "plpy_planobject.h"
#include "plpy_resultobject.h"
#include "plpy_spi.h"
#include "plpython.h"
#include "utils/memutils.h"
Go to the source code of this file.
Functions | |
static PyObject * | PLy_cursor_query (const char *query) |
static void | PLy_cursor_dealloc (PyObject *arg) |
static PyObject * | PLy_cursor_iternext (PyObject *self) |
static PyObject * | PLy_cursor_fetch (PyObject *self, PyObject *args) |
static PyObject * | PLy_cursor_close (PyObject *self, PyObject *unused) |
void | PLy_cursor_init_type (void) |
PyObject * | PLy_cursor (PyObject *self, PyObject *args) |
PyObject * | PLy_cursor_plan (PyObject *ob, PyObject *args) |
Variables | |
static const char | PLy_cursor_doc [] = "Wrapper around a PostgreSQL cursor" |
static PyMethodDef | PLy_cursor_methods [] |
static PyTypeObject | PLy_CursorType |
PyObject* PLy_cursor | ( | PyObject * | self, |
PyObject * | args | ||
) |
Definition at line 56 of file plpy_cursorobject.c.
References generate_unaccent_rules::args, plan, PLy_cursor_plan(), PLy_cursor_query(), PLy_exc_error, and PLy_exception_set().
|
static |
Definition at line 469 of file plpy_cursorobject.c.
References GetPortalByName(), PLy_exception_set(), PortalIsValid, SPI_cursor_close(), and UnpinPortal().
|
static |
Definition at line 279 of file plpy_cursorobject.c.
References arg, GetPortalByName(), MemoryContextDelete(), PortalIsValid, SPI_cursor_close(), and UnpinPortal().
|
static |
Definition at line 368 of file plpy_cursorobject.c.
References generate_unaccent_rules::args, PLyExecutionContext::curr_proc, CurrentMemoryContext, CurrentResourceOwner, ereport, errcode(), errmsg(), ERROR, GetPortalByName(), i, PLyResultObject::nrows, PG_CATCH, PG_END_TRY, PG_TRY, PLy_current_execution_context(), PLy_exception_set(), PLy_input_from_tuple(), PLy_input_setup_tuple(), PLy_result_new(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), PortalIsValid, PLyResultObject::rows, SPI_cursor_fetch(), SPI_freetuptable(), SPI_OK_FETCH, SPI_processed, SPI_tuptable, PLyResultObject::status, SPITupleTable::tupdesc, and SPITupleTable::vals.
void PLy_cursor_init_type | ( | void | ) |
Definition at line 49 of file plpy_cursorobject.c.
References elog, ERROR, and PLy_CursorType.
Referenced by PLy_init_plpy().
|
static |
Definition at line 306 of file plpy_cursorobject.c.
References PLyExecutionContext::curr_proc, CurrentMemoryContext, CurrentResourceOwner, GetPortalByName(), PG_CATCH, PG_END_TRY, PG_TRY, PLy_current_execution_context(), PLy_exception_set(), PLy_input_from_tuple(), PLy_input_setup_tuple(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), PortalIsValid, SPI_cursor_fetch(), SPI_freetuptable(), SPI_processed, SPI_tuptable, SPITupleTable::tupdesc, and SPITupleTable::vals.
PyObject* PLy_cursor_plan | ( | PyObject * | ob, |
PyObject * | args | ||
) |
Definition at line 139 of file plpy_cursorobject.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, arg, generate_unaccent_rules::args, Assert, PLyExecutionContext::curr_proc, CurrentMemoryContext, CurrentResourceOwner, DatumGetPointer(), elog, ERROR, PLyProcedure::fn_readonly, i, j, MemoryContextStrdup(), PortalData::name, palloc(), pfree(), PG_CATCH, PG_END_TRY, PG_FINALLY, PG_TRY, PinPortal(), plan, PLy_current_execution_context(), PLy_CursorType, PLy_elog, PLy_exception_set(), PLy_exception_set_plural(), PLy_input_setup_func(), PLy_output_convert(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), PLyUnicode_AsString(), PointerGetDatum(), SPI_cursor_open(), SPI_result, SPI_result_code_string(), and TopMemoryContext.
Referenced by PLy_cursor(), and PLy_plan_cursor().
|
static |
Definition at line 76 of file plpy_cursorobject.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, PLyExecutionContext::curr_proc, CurrentMemoryContext, CurrentResourceOwner, elog, ERROR, PLyProcedure::fn_readonly, MemoryContextStrdup(), PortalData::name, PG_CATCH, PG_END_TRY, PG_TRY, pg_verifymbstr(), PinPortal(), plan, PLy_current_execution_context(), PLy_CursorType, PLy_input_setup_func(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), SPI_cursor_open(), SPI_freeplan(), SPI_prepare(), SPI_result, SPI_result_code_string(), and TopMemoryContext.
Referenced by PLy_cursor().
Definition at line 28 of file plpy_cursorobject.c.
|
static |
Definition at line 30 of file plpy_cursorobject.c.
|
static |
Definition at line 36 of file plpy_cursorobject.c.
Referenced by PLy_cursor_init_type(), PLy_cursor_plan(), and PLy_cursor_query().