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.
Functions | |
PG_FUNCTION_INFO_V1 (plpython3_validator) | |
PG_FUNCTION_INFO_V1 (plpython3_call_handler) | |
PG_FUNCTION_INFO_V1 (plpython3_inline_handler) | |
static bool | PLy_procedure_is_trigger (Form_pg_proc procStruct) |
static void | plpython_error_callback (void *arg) |
static void | plpython_inline_error_callback (void *arg) |
static void | PLy_init_interp (void) |
static PLyExecutionContext * | PLy_push_execution_context (bool atomic_context) |
static void | PLy_pop_execution_context (void) |
void | _PG_init (void) |
static void | PLy_initialize (void) |
Datum | plpython3_validator (PG_FUNCTION_ARGS) |
Datum | plpython3_call_handler (PG_FUNCTION_ARGS) |
Datum | plpython3_inline_handler (PG_FUNCTION_ARGS) |
PLyExecutionContext * | PLy_current_execution_context (void) |
MemoryContext | PLy_get_scratch_context (PLyExecutionContext *context) |
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 58 of file plpy_main.c.
References find_rendezvous_variable(), pg_bindtextdomain(), plpython_version_bitmask, plpython_version_bitmask_ptr, and TEXTDOMAIN.
PG_FUNCTION_INFO_V1 | ( | plpython3_call_handler | ) |
PG_FUNCTION_INFO_V1 | ( | plpython3_inline_handler | ) |
PG_FUNCTION_INFO_V1 | ( | plpython3_validator | ) |
Datum plpython3_call_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 191 of file plpy_main.c.
References ErrorContextCallback::arg, ErrorContextCallback::callback, CALLED_AS_TRIGGER, castNode, PLyExecutionContext::curr_proc, 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(), and SPI_OPT_NONATOMIC.
Datum plpython3_inline_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 262 of file plpy_main.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, ErrorContextCallback::arg, InlineCodeBlock::atomic, ErrorContextCallback::callback, PLyExecutionContext::curr_proc, CurrentMemoryContext, DatumGetPointer(), 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_OPT_NONATOMIC, TopMemoryContext, and PLyObToDatum::typoid.
Datum plpython3_validator | ( | PG_FUNCTION_ARGS | ) |
Definition at line 158 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(), ReleaseSysCache(), and SearchSysCache1().
|
static |
Definition at line 343 of file plpy_main.c.
References arg, PLyExecutionContext::curr_proc, errcontext, PLyProcedure::is_procedure, and PLy_procedure_name().
Referenced by plpython3_call_handler().
|
static |
Definition at line 359 of file plpy_main.c.
References errcontext.
Referenced by plpython3_inline_handler().
PLyExecutionContext* PLy_current_execution_context | ( | void | ) |
Definition at line 365 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 374 of file plpy_main.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, context, and TopTransactionContext.
Referenced by PLy_input_convert(), and PLy_input_from_tuple().
|
static |
Definition at line 138 of file plpy_main.c.
References ERROR, PLy_elog, and PLy_interp_globals.
Referenced by PLy_initialize().
|
static |
Definition at line 95 of file plpy_main.c.
References ereport, errdetail(), errmsg(), explicit_subtransactions, FATAL, init_procedure_caches(), NIL, plpython_version_bitmask_ptr, PLy_elog, PLy_execution_contexts, PLy_init_interp(), PLy_init_plpy(), and PyInit_plpy().
Referenced by plpython3_call_handler(), plpython3_inline_handler(), and plpython3_validator().
|
static |
Definition at line 405 of file plpy_main.c.
References context, elog, ERROR, MemoryContextDelete(), pfree(), and PLy_execution_contexts.
Referenced by plpython3_call_handler(), and plpython3_inline_handler().
|
static |
Definition at line 337 of file plpy_main.c.
Referenced by plpython3_validator().
|
static |
Definition at line 389 of file plpy_main.c.
References context, MemoryContextAlloc(), PLy_execution_contexts, PortalContext, and TopTransactionContext.
Referenced by plpython3_call_handler(), and plpython3_inline_handler().
PG_MODULE_MAGIC |
Definition at line 31 of file plpy_main.c.
|
static |
Definition at line 48 of file plpy_main.c.
Referenced by _PG_init().
|
static |
Definition at line 47 of file plpy_main.c.
Referenced by _PG_init(), and PLy_initialize().
|
static |
Definition at line 54 of file plpy_main.c.
Referenced by PLy_current_execution_context(), PLy_initialize(), PLy_pop_execution_context(), and PLy_push_execution_context().
PyObject* PLy_interp_globals = NULL |
Definition at line 51 of file plpy_main.c.
Referenced by PLy_init_interp(), and PLy_procedure_compile().