46 return "<unknown procedure>";
132 pcache->proc->cfunc.use_count--;
159 "__plpython_procedure_%s_%u",
162 if (rv >=
sizeof(
procName) || rv < 0)
163 elog(
ERROR,
"procedure name would overrun buffer");
168 if (!((*ptr >=
'A' && *ptr <=
'Z') ||
169 (*ptr >=
'a' && *ptr <=
'z') ||
170 (*ptr >=
'0' && *ptr <=
'9')))
176 "PL/Python function",
225 elog(
ERROR,
"cache lookup failed for type %u", rettype);
237 errmsg(
"trigger functions can only be called as triggers")));
241 errmsg(
"PL/Python functions cannot return type %s",
285 for (
i = 0;
i < total;
i++)
297 for (
i = pos = 0;
i < total;
i++)
319 errmsg(
"PL/Python functions cannot accept type %s",
402 elog(
ERROR,
"string would overflow buffer");
409 PLy_elog(
ERROR,
"could not compile PL/Python function \"%s\"",
412 PLy_elog(
ERROR,
"could not compile anonymous PL/Python code block");
447 if (*
sp ==
'\r' && *(
sp + 1) ==
'\n')
450 if (*
sp ==
'\n' || *
sp ==
'\r')
464 elog(
FATAL,
"buffer overrun in PLy_procedure_munge_source");
547 pcache->proc->cfunc.use_count--;
#define TextDatumGetCString(d)
#define Assert(condition)
int errcode(int sqlerrcode)
#define ereport(elevel,...)
#define CALLED_AS_EVENT_TRIGGER(fcinfo)
#define palloc0_array(type, count)
int get_func_arg_info(HeapTuple procTup, Oid **p_argtypes, char ***p_argnames, char **p_argmodes)
CachedFunction * cached_function_compile(FunctionCallInfo fcinfo, CachedFunction *function, CachedFunctionCompileCallback ccallback, CachedFunctionDeleteCallback dcallback, Size cacheEntrySize, bool includeResultType, bool forValidator)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
char * MemoryContextStrdup(MemoryContext context, const char *string)
void * MemoryContextAllocZero(MemoryContext context, Size size)
char * pstrdup(const char *in)
void MemoryContextRegisterResetCallback(MemoryContext context, MemoryContextCallback *cb)
void pfree(void *pointer)
MemoryContext TopMemoryContext
void MemoryContextDelete(MemoryContext context)
void MemoryContextSetIdentifier(MemoryContext context, const char *id)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
List * oid_array_to_list(Datum datum)
END_CATALOG_STRUCT typedef FormData_pg_proc * Form_pg_proc
END_CATALOG_STRUCT typedef FormData_pg_type * Form_pg_type
void PLy_function_cleanup_srfstate(PLyProcedureCache *pcache)
PyObject * PLy_interp_globals
char * PLy_procedure_name(PLyProcedure *proc)
static void PLy_procedure_create(PLyProcedure *proc, HeapTuple procTup, Oid fn_oid, PLyTrigType is_trigger)
static void PLy_compile_callback(FunctionCallInfo fcinfo, HeapTuple procTup, const CachedFunctionHashKey *hashkey, CachedFunction *cfunc, bool forValidator)
PLyProcedureCache * PLy_procedure_get(FunctionCallInfo fcinfo, bool forValidator)
static void PLy_delete_callback(CachedFunction *cfunc)
static char * PLy_procedure_munge_source(const char *name, const char *src)
static void RemovePLyProcedureCache(void *arg)
void PLy_procedure_compile(PLyProcedure *proc, const char *src)
void PLy_procedure_delete(PLyProcedure *proc)
void PLy_output_setup_func(PLyObToDatum *arg, MemoryContext arg_mcxt, Oid typeOid, int32 typmod, PLyProcedure *proc)
void PLy_input_setup_func(PLyDatumToOb *arg, MemoryContext arg_mcxt, Oid typeOid, int32 typmod, PLyProcedure *proc)
static Datum ObjectIdGetDatum(Oid X)
void ReleaseSysCache(HeapTuple tuple)
Datum SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
#define CALLED_AS_TRIGGER(fcinfo)