PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/xact.h"
#include "catalog/pg_type.h"
#include "commands/trigger.h"
#include "executor/spi.h"
#include "funcapi.h"
#include "plpy_elog.h"
#include "plpy_exec.h"
#include "plpy_main.h"
#include "plpy_procedure.h"
#include "plpy_subxactobject.h"
#include "plpython.h"
#include "utils/fmgrprotos.h"
#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
struct | PLySRFState |
Typedefs | |
typedef struct PLySRFState | PLySRFState |
typedef struct PLySRFState PLySRFState |
|
static |
Definition at line 693 of file plpy_exec.c.
References PLyExecutionContext::curr_proc, errcontext, PLyProcedure::is_procedure, and PLy_current_execution_context().
Referenced by PLy_exec_function().
|
static |
Definition at line 679 of file plpy_exec.c.
References arg, PLySRFState::iter, PLy_function_drop_args(), and PLySRFState::savedargs.
Referenced by PLy_exec_function().
|
static |
Definition at line 1050 of file plpy_exec.c.
References PLyExecutionContext::curr_proc, errcontext, and PLy_current_execution_context().
Referenced by PLy_modify_tuple().
|
static |
Definition at line 1102 of file plpy_exec.c.
References Assert, CurrentResourceOwner, ereport, errmsg(), explicit_subtransactions, linitial, list_delete_first(), list_length(), MemoryContextSwitchTo(), NIL, PLySubtransactionData::oldcontext, PLySubtransactionData::oldowner, pfree(), RollbackAndReleaseCurrentSubTransaction(), and WARNING.
Referenced by PLy_procedure_call().
Datum PLy_exec_function | ( | FunctionCallInfo | fcinfo, |
PLyProcedure * | proc | ||
) |
Definition at line 53 of file plpy_exec.c.
References ReturnSetInfo::allowedModes, MemoryContextCallback::arg, Assert, ErrorContextCallback::callback, PLySRFState::callback, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, error_context_stack, MemoryContextCallback::func, get_call_result_type(), if(), PLyProcedure::is_procedure, PLyProcedure::is_setof, IsA, FunctionCallInfoBaseData::isnull, PLySRFState::iter, MemoryContextAllocZero(), MemoryContextRegisterResetCallback(), FuncCallContext::multi_call_memory_ctx, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, plpython_return_error_callback(), plpython_srf_cleanup_callback(), PLy_elog, PLy_function_build_args(), PLy_function_drop_args(), PLy_function_restore_args(), PLy_function_save_args(), PLy_global_args_pop(), PLy_global_args_push(), PLy_output_convert(), PLy_output_setup_record(), PLy_procedure_call(), ErrorContextCallback::previous, PLyProcedure::result, FunctionCallInfoBaseData::resultinfo, ReturnSetInfo::returnMode, PLySRFState::savedargs, SFRM_ValuePerCall, SPI_finish(), SPI_OK_FINISH, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, SRF_RETURN_NEXT_NULL, TYPEFUNC_COMPOSITE, PLyObToDatum::typoid, and FuncCallContext::user_fctx.
Referenced by plpython3_call_handler(), and plpython3_inline_handler().
HeapTuple PLy_exec_trigger | ( | FunctionCallInfo | fcinfo, |
PLyProcedure * | proc | ||
) |
Definition at line 319 of file plpy_exec.c.
References Assert, CALLED_AS_TRIGGER, FunctionCallInfoBaseData::context, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, PLyProcedure::mcxt, PG_END_TRY, PG_FINALLY, pg_strcasecmp(), PG_TRY, PG_USED_FOR_ASSERTS_ONLY, PLy_global_args_pop(), PLy_global_args_push(), PLy_input_setup_func(), PLy_input_setup_tuple(), PLy_modify_tuple(), PLy_output_setup_func(), PLy_output_setup_tuple(), PLy_procedure_call(), PLy_trigger_build_args(), PLyUnicode_AsString(), RelationGetDescr, PLyProcedure::result, PLyProcedure::result_in, SPI_finish(), SPI_OK_FINISH, SPI_register_trigger_data(), TupleDescData::tdtypeid, TupleDescData::tdtypmod, TriggerData::tg_event, TriggerData::tg_relation, TRIGGER_FIRED_BY_INSERT, TRIGGER_FIRED_BY_UPDATE, PLyDatumToOb::typoid, PLyObToDatum::typoid, and WARNING.
Referenced by plpython3_call_handler().
|
static |
Definition at line 433 of file plpy_exec.c.
References arg, PLyProcedure::argnames, generate_unaccent_rules::args, FunctionCallInfoBaseData::args, PLyProcedure::args, ERROR, PLyProcedure::globals, i, NullableDatum::isnull, PLyProcedure::nargs, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PLy_elog, PLy_input_convert(), and NullableDatum::value.
Referenced by PLy_exec_function().
|
static |
Definition at line 582 of file plpy_exec.c.
References PLySavedArgs::args, i, PLySavedArgs::namedargs, PLySavedArgs::nargs, pfree(), and PLySavedArgs::td.
Referenced by plpython_srf_cleanup_callback(), and PLy_exec_function().
|
static |
Definition at line 542 of file plpy_exec.c.
References PLyProcedure::argnames, PLySavedArgs::args, PLyProcedure::globals, i, PLySavedArgs::namedargs, PLySavedArgs::nargs, pfree(), and PLySavedArgs::td.
Referenced by PLy_exec_function(), and PLy_global_args_pop().
|
static |
Definition at line 496 of file plpy_exec.c.
References PLyProcedure::argnames, PLySavedArgs::args, PLyProcedure::globals, i, PLyProcedure::is_trigger, PLyProcedure::mcxt, MemoryContextAllocZero(), PLySavedArgs::namedargs, PLySavedArgs::nargs, PLyProcedure::nargs, and PLySavedArgs::td.
Referenced by PLy_exec_function(), and PLy_global_args_push().
|
static |
Definition at line 641 of file plpy_exec.c.
References PLyProcedure::argstack, Assert, PLyProcedure::calldepth, PLySavedArgs::next, and PLy_function_restore_args().
Referenced by PLy_exec_function(), and PLy_exec_trigger().
|
static |
Definition at line 611 of file plpy_exec.c.
References PLyProcedure::argstack, PLyProcedure::calldepth, PLySavedArgs::next, and PLy_function_save_args().
Referenced by PLy_exec_function(), and PLy_exec_trigger().
|
static |
Definition at line 920 of file plpy_exec.c.
References PLyObToTuple::atts, ErrorContextCallback::callback, elog, ereport, errcode(), errmsg(), ERROR, error_context_stack, FATAL, heap_modify_tuple(), i, TupleDescData::natts, palloc0(), pfree(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, plpython_trigger_error_callback(), PLy_output_convert(), PLyUnicode_AsString(), ErrorContextCallback::previous, RelationGetDescr, PLyProcedure::result, SPI_ERROR_NOATTRIBUTE, SPI_fnumber(), TriggerData::tg_relation, PLyObToDatum::tuple, TupleDescAttr, and PLyObToDatum::u.
Referenced by PLy_exec_trigger().
|
static |
Definition at line 1060 of file plpy_exec.c.
References Assert, PLyProcedure::code, ERROR, explicit_subtransactions, PLyProcedure::globals, list_length(), PG_END_TRY, PG_FINALLY, PG_TRY, PLy_abort_open_subtransactions(), and PLy_elog.
Referenced by PLy_exec_function(), and PLy_exec_trigger().
|
static |
Definition at line 703 of file plpy_exec.c.
References Assert, FunctionCallInfoBaseData::context, DatumGetCString(), DirectFunctionCall1, elog, ERROR, i, ObjectIdGetDatum(), oidout(), pfree(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PLy_input_from_tuple(), PLyUnicode_FromString(), RelationData::rd_id, RelationGetDescr, PLyProcedure::result_in, SPI_getnspname(), SPI_getrelname(), TriggerData::tg_event, TriggerData::tg_newtuple, TriggerData::tg_relation, TriggerData::tg_trigger, TriggerData::tg_trigtuple, Trigger::tgargs, Trigger::tgname, Trigger::tgnargs, TRIGGER_FIRED_AFTER, TRIGGER_FIRED_BEFORE, TRIGGER_FIRED_BY_DELETE, TRIGGER_FIRED_BY_INSERT, TRIGGER_FIRED_BY_TRUNCATE, TRIGGER_FIRED_BY_UPDATE, TRIGGER_FIRED_FOR_ROW, TRIGGER_FIRED_FOR_STATEMENT, and TRIGGER_FIRED_INSTEAD.
Referenced by PLy_exec_trigger().