PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "commands/trigger.h"
#include "executor/spi.h"
#include "miscadmin.h"
#include "plpy_elog.h"
#include "plpy_exec.h"
#include "plpy_main.h"
#include "plpy_plpymodule.h"
#include "plpy_procedure.h"
#include "plpy_subxactobject.h"
#include "plpython.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Variables | |
PG_MODULE_MAGIC | |
static int * | plpython_version_bitmask_ptr = NULL |
static int | plpython_version_bitmask = 0 |
PyObject * | PLy_interp_globals = NULL |
static PLyExecutionContext * | PLy_execution_contexts = NULL |
void _PG_init | ( | void | ) |
Definition at line 74 of file plpy_main.c.
References find_rendezvous_variable(), pg_bindtextdomain(), plpython_version_bitmask, plpython_version_bitmask_ptr, and TEXTDOMAIN.
PG_FUNCTION_INFO_V1 | ( | plpython_validator | ) |
PG_FUNCTION_INFO_V1 | ( | plpython_call_handler | ) |
PG_FUNCTION_INFO_V1 | ( | plpython_inline_handler | ) |
PG_FUNCTION_INFO_V1 | ( | plpython2_validator | ) |
PG_FUNCTION_INFO_V1 | ( | plpython2_call_handler | ) |
PG_FUNCTION_INFO_V1 | ( | plpython2_inline_handler | ) |
Datum plpython2_call_handler | ( | PG_FUNCTION_ARGS | ) |
Datum plpython2_inline_handler | ( | PG_FUNCTION_ARGS | ) |
Datum plpython2_validator | ( | PG_FUNCTION_ARGS | ) |
Datum plpython_call_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 216 of file plpy_main.c.
References ErrorContextCallback::arg, ErrorContextCallback::callback, CALLED_AS_TRIGGER, castNode, PLyExecutionContext::curr_proc, elog, ERROR, error_context_stack, InvalidOid, IsA, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, plpython_error_callback(), PLy_exec_function(), PLy_exec_trigger(), PLy_initialize(), PLy_pop_execution_context(), PLy_procedure_get(), PLy_push_execution_context(), PointerGetDatum, ErrorContextCallback::previous, RelationGetRelid, SPI_connect_ext(), SPI_OK_CONNECT, and SPI_OPT_NONATOMIC.
Referenced by plpython2_call_handler().
|
static |
Definition at line 386 of file plpy_main.c.
References PLyExecutionContext::curr_proc, errcontext, PLyProcedure::is_procedure, and PLy_procedure_name().
Referenced by plpython_call_handler().
|
static |
Definition at line 402 of file plpy_main.c.
References errcontext.
Referenced by plpython_inline_handler().
Datum plpython_inline_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 296 of file plpy_main.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, ErrorContextCallback::arg, InlineCodeBlock::atomic, ErrorContextCallback::callback, PLyExecutionContext::curr_proc, CurrentMemoryContext, DatumGetPointer, elog, ERROR, error_context_stack, FmgrInfo::fn_mcxt, FmgrInfo::fn_oid, InvalidOid, PLyProcedure::langid, InlineCodeBlock::langOid, LOCAL_FCINFO, PLyProcedure::mcxt, MemoryContextStrdup(), MemSet, PG_CATCH, PG_END_TRY, PG_GETARG_DATUM, PG_RE_THROW, PG_RETURN_VOID, PG_TRY, plpython_inline_error_callback(), PLy_exec_function(), PLy_initialize(), PLy_pop_execution_context(), PLy_procedure_compile(), PLy_procedure_delete(), PLy_push_execution_context(), ErrorContextCallback::previous, PLyProcedure::pyname, PLyProcedure::result, SizeForFunctionCallInfo, InlineCodeBlock::source_text, SPI_connect_ext(), SPI_OK_CONNECT, SPI_OPT_NONATOMIC, TopMemoryContext, and PLyObToDatum::typoid.
Referenced by plpython2_inline_handler().
Datum plpython_validator | ( | PG_FUNCTION_ARGS | ) |
Definition at line 174 of file plpy_main.c.
References check_function_bodies, CheckFunctionValidatorAccess(), elog, ERROR, GETSTRUCT, HeapTupleIsValid, InvalidOid, ObjectIdGetDatum, PG_GETARG_OID, PG_RETURN_VOID, PLy_initialize(), PLy_procedure_get(), PLy_procedure_is_trigger(), PROCOID, ReleaseSysCache(), and SearchSysCache1().
Referenced by plpython2_validator().
PLyExecutionContext* PLy_current_execution_context | ( | void | ) |
Definition at line 408 of file plpy_main.c.
References elog, ERROR, and PLy_execution_contexts.
Referenced by plpython_return_error_callback(), plpython_trigger_error_callback(), PLy_commit(), PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_input_convert(), PLy_input_from_tuple(), PLy_rollback(), PLy_spi_execute_fetch_result(), PLy_spi_execute_plan(), PLy_spi_execute_query(), PLy_spi_prepare(), PLy_traceback(), PLyDict_FromComposite(), and PLyObject_ToComposite().
MemoryContext PLy_get_scratch_context | ( | PLyExecutionContext * | context | ) |
Definition at line 417 of file plpy_main.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, PLyExecutionContext::scratch_ctx, and TopTransactionContext.
Referenced by PLy_input_convert(), and PLy_input_from_tuple().
|
static |
Definition at line 154 of file plpy_main.c.
References ERROR, PLy_elog, and PLy_interp_globals.
Referenced by PLy_initialize().
|
static |
Definition at line 107 of file plpy_main.c.
References ereport, errdetail(), errmsg(), explicit_subtransactions, FATAL, init_procedure_caches(), NIL, plpython_version_bitmask_ptr, PLy_elog, PLy_init_interp(), and PLy_init_plpy().
Referenced by plpython_call_handler(), plpython_inline_handler(), and plpython_validator().
|
static |
Definition at line 448 of file plpy_main.c.
References elog, ERROR, MemoryContextDelete(), PLyExecutionContext::next, pfree(), PLy_execution_contexts, and PLyExecutionContext::scratch_ctx.
Referenced by plpython_call_handler(), and plpython_inline_handler().
|
static |
Definition at line 380 of file plpy_main.c.
Referenced by plpython_validator().
|
static |
Definition at line 432 of file plpy_main.c.
References PLyExecutionContext::curr_proc, MemoryContextAlloc(), PLyExecutionContext::next, PLy_execution_contexts, PortalContext, PLyExecutionContext::scratch_ctx, and TopTransactionContext.
Referenced by plpython_call_handler(), and plpython_inline_handler().
PG_MODULE_MAGIC |
Definition at line 40 of file plpy_main.c.
|
static |
Definition at line 64 of file plpy_main.c.
Referenced by _PG_init().
|
static |
Definition at line 63 of file plpy_main.c.
Referenced by _PG_init(), and PLy_initialize().
|
static |
Definition at line 70 of file plpy_main.c.
Referenced by PLy_current_execution_context(), PLy_pop_execution_context(), and PLy_push_execution_context().
PyObject* PLy_interp_globals = NULL |
Definition at line 67 of file plpy_main.c.
Referenced by PLy_init_interp(), and PLy_procedure_compile().