PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "plpy_elog.h"
#include "plpy_main.h"
#include "plpy_procedure.h"
#include "plpython.h"
#include "utils/builtins.h"
#include "utils/hsearch.h"
#include "utils/memutils.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
static PLyProcedure * | PLy_procedure_create (HeapTuple procTup, Oid fn_oid, bool is_trigger) |
static bool | PLy_procedure_valid (PLyProcedure *proc, HeapTuple procTup) |
static char * | PLy_procedure_munge_source (const char *name, const char *src) |
void | init_procedure_caches (void) |
char * | PLy_procedure_name (PLyProcedure *proc) |
PLyProcedure * | PLy_procedure_get (Oid fn_oid, Oid fn_rel, bool is_trigger) |
void | PLy_procedure_compile (PLyProcedure *proc, const char *src) |
void | PLy_procedure_delete (PLyProcedure *proc) |
Variables | |
static HTAB * | PLy_procedure_cache = NULL |
void init_procedure_caches | ( | void | ) |
Definition at line 30 of file plpy_procedure.c.
References HASHCTL::entrysize, HASH_BLOBS, hash_create(), HASH_ELEM, HASHCTL::keysize, and PLy_procedure_cache.
Referenced by PLy_initialize().
void PLy_procedure_compile | ( | PLyProcedure * | proc, |
const char * | src | ||
) |
Definition at line 349 of file plpy_procedure.c.
References PLyProcedure::code, elog, ERROR, 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 130 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, PLyProcedure::fn_readonly, PLyProcedure::fn_tid, PLyProcedure::fn_xmin, format_type_be(), get_func_arg_info(), GETSTRUCT, PLyProcedure::globals, HeapTupleHeaderGetRawXmin, 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(), pfree(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, 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(), HeapTupleData::t_data, HeapTupleData::t_self, TextDatumGetCString, TopMemoryContext, PLyProcedure::trftypes, types, PLyDatumToOb::typoid, and PLyObToDatum::typoid.
Referenced by PLy_procedure_get().
void PLy_procedure_delete | ( | PLyProcedure * | proc | ) |
Definition at line 400 of file plpy_procedure.c.
References PLyProcedure::code, PLyProcedure::globals, PLyProcedure::mcxt, MemoryContextDelete(), and PLyProcedure::statics.
Referenced by plpython3_inline_handler(), PLy_procedure_create(), and PLy_procedure_get().
PLyProcedure* PLy_procedure_get | ( | Oid | fn_oid, |
Oid | fn_rel, | ||
bool | is_trigger | ||
) |
Definition at line 66 of file plpy_procedure.c.
References elog, ERROR, HASH_ENTER, HASH_REMOVE, hash_search(), HeapTupleIsValid, InvalidOid, sort-test::key, ObjectIdGetDatum(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PLy_procedure_cache, PLy_procedure_create(), PLy_procedure_delete(), PLy_procedure_valid(), PLyProcedureEntry::proc, ReleaseSysCache(), and SearchSysCache1().
Referenced by plpython3_call_handler(), and plpython3_validator().
|
static |
Definition at line 426 of file plpy_procedure.c.
References Assert, elog, FATAL, name, palloc(), and snprintf.
Referenced by PLy_procedure_compile().
char* PLy_procedure_name | ( | PLyProcedure * | proc | ) |
Definition at line 46 of file plpy_procedure.c.
References PLyProcedure::proname.
Referenced by plpython_error_callback(), and PLy_traceback().
|
static |
Definition at line 412 of file plpy_procedure.c.
References PLyProcedure::fn_tid, PLyProcedure::fn_xmin, HeapTupleHeaderGetRawXmin, ItemPointerEquals(), HeapTupleData::t_data, and HeapTupleData::t_self.
Referenced by PLy_procedure_get().
|
static |
Definition at line 22 of file plpy_procedure.c.
Referenced by init_procedure_caches(), and PLy_procedure_get().