|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "catalog/pg_proc.h"#include "catalog/pg_type.h"#include "commands/event_trigger.h"#include "commands/trigger.h"#include "funcapi.h"#include "plpy_elog.h"#include "plpy_exec.h"#include "plpy_main.h"#include "plpy_procedure.h"#include "plpy_util.h"#include "utils/builtins.h"#include "utils/funccache.h"#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
| static void | PLy_procedure_create (PLyProcedure *proc, HeapTuple procTup, Oid fn_oid, PLyTrigType is_trigger) |
| static char * | PLy_procedure_munge_source (const char *name, const char *src) |
| static void | PLy_compile_callback (FunctionCallInfo fcinfo, HeapTuple procTup, const CachedFunctionHashKey *hashkey, CachedFunction *cfunc, bool forValidator) |
| static void | PLy_delete_callback (CachedFunction *cfunc) |
| static void | RemovePLyProcedureCache (void *arg) |
| char * | PLy_procedure_name (PLyProcedure *proc) |
| PLyProcedureCache * | PLy_procedure_get (FunctionCallInfo fcinfo, bool forValidator) |
| void | PLy_procedure_compile (PLyProcedure *proc, const char *src) |
| void | PLy_procedure_delete (PLyProcedure *proc) |
|
static |
Definition at line 478 of file plpy_procedure.c.
References CALLED_AS_EVENT_TRIGGER, CALLED_AS_TRIGGER, fb(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_oid, PLPY_EVENT_TRIGGER, PLPY_NOT_TRIGGER, PLPY_TRIGGER, and PLy_procedure_create().
Referenced by PLy_procedure_get().
|
static |
Definition at line 510 of file plpy_procedure.c.
References Assert, PLyProcedure::calldepth, PLyProcedure::cfunc, PLy_procedure_delete(), and CachedFunction::use_count.
Referenced by PLy_procedure_get().
| void PLy_procedure_compile | ( | PLyProcedure * | proc, |
| const char * | src | ||
| ) |
Definition at line 362 of file plpy_procedure.c.
References PLyProcedure::code, elog, ERROR, fb(), PLyProcedure::globals, PLyProcedure::mcxt, MemoryContextStrdup(), NAMEDATALEN, pfree(), PLy_elog, PLy_interp_globals, PLy_procedure_munge_source(), PLyProcedure::proname, PLyProcedure::pyname, snprintf, PLyProcedure::src, and PLyProcedure::statics.
Referenced by plpython3_inline_handler(), and PLy_procedure_create().
|
static |
Definition at line 145 of file plpy_procedure.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, PLyProcedure::argnames, PLyProcedure::args, PLyProcedure::argstack, Assert, PLyProcedure::calldepth, PLyProcedure::code, elog, ereport, errcode(), errmsg, ERROR, fb(), PLyProcedure::fn_readonly, Form_pg_proc, Form_pg_type, format_type_be(), get_func_arg_info(), GETSTRUCT(), PLyProcedure::globals, HeapTupleIsValid, i, InvalidOid, PLyProcedure::is_procedure, PLyProcedure::is_setof, PLyProcedure::is_trigger, PLyProcedure::langid, PLyProcedure::mcxt, MemoryContextSetIdentifier(), MemoryContextSwitchTo(), NAMEDATALEN, NameStr, PLyProcedure::nargs, NIL, ObjectIdGetDatum(), oid_array_to_list(), palloc0_array, pfree(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PLPY_NOT_TRIGGER, PLy_input_setup_func(), PLy_output_setup_func(), PLy_procedure_compile(), PLy_procedure_delete(), PLyProcedure::proname, pstrdup(), PLyProcedure::pyname, ReleaseSysCache(), PLyProcedure::result, PLyProcedure::result_in, SearchSysCache1(), snprintf, PLyProcedure::src, PLyProcedure::statics, SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, TopMemoryContext, PLyProcedure::trftypes, types, PLyDatumToOb::typoid, and PLyObToDatum::typoid.
Referenced by PLy_compile_callback().
| void PLy_procedure_delete | ( | PLyProcedure * | proc | ) |
Definition at line 416 of file plpy_procedure.c.
References PLyProcedure::code, fb(), PLyProcedure::globals, PLyProcedure::mcxt, MemoryContextDelete(), and PLyProcedure::statics.
Referenced by plpython3_inline_handler(), PLy_delete_callback(), and PLy_procedure_create().
| PLyProcedureCache * PLy_procedure_get | ( | FunctionCallInfo | fcinfo, |
| bool | forValidator | ||
| ) |
Definition at line 62 of file plpy_procedure.c.
References Assert, cached_function_compile(), PLyProcedure::cfunc, fb(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, FmgrInfo::fn_mcxt, MemoryContextAllocZero(), MemoryContextRegisterResetCallback(), PLy_compile_callback(), PLy_delete_callback(), RemovePLyProcedureCache(), and CachedFunction::use_count.
Referenced by plpython3_call_handler(), and plpython3_validator().
Definition at line 425 of file plpy_procedure.c.
References Assert, elog, FATAL, fb(), name, palloc(), and snprintf.
Referenced by PLy_procedure_compile().
| char * PLy_procedure_name | ( | PLyProcedure * | proc | ) |
Definition at line 43 of file plpy_procedure.c.
References fb(), and PLyProcedure::proname.
Referenced by plpython_error_callback(), and PLy_traceback().
Definition at line 536 of file plpy_procedure.c.
References arg, Assert, fb(), and PLy_function_cleanup_srfstate().
Referenced by PLy_procedure_get().