49 return "<unknown procedure>";
87 elog(
ERROR,
"cache lookup failed for function %u", fn_oid);
158 "__plpython_procedure_%s_%u",
161 if (rv >=
sizeof(
procName) || rv < 0)
162 elog(
ERROR,
"procedure name would overrun buffer");
167 if (!((*ptr >=
'A' && *ptr <=
'Z') ||
168 (*ptr >=
'a' && *ptr <=
'z') ||
169 (*ptr >=
'0' && *ptr <=
'9')))
175 "PL/Python function",
227 elog(
ERROR,
"cache lookup failed for type %u", rettype);
239 errmsg(
"trigger functions can only be called as triggers")));
243 errmsg(
"PL/Python functions cannot return type %s",
287 for (
i = 0;
i < total;
i++)
299 for (
i = pos = 0;
i < total;
i++)
321 errmsg(
"PL/Python functions cannot accept type %s",
405 elog(
ERROR,
"string would overflow buffer");
412 PLy_elog(
ERROR,
"could not compile PL/Python function \"%s\"",
415 PLy_elog(
ERROR,
"could not compile anonymous PL/Python code block");
467 if (*
sp ==
'\r' && *(
sp + 1) ==
'\n')
470 if (*
sp ==
'\n' || *
sp ==
'\r')
484 elog(
FATAL,
"buffer overrun in PLy_procedure_munge_source");
#define TextDatumGetCString(d)
#define Assert(condition)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, int64 nelem, const HASHCTL *info, int flags)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc0_array(type, count)
#define palloc0_object(type)
int get_func_arg_info(HeapTuple procTup, Oid **p_argtypes, char ***p_argnames, char **p_argmodes)
#define HeapTupleIsValid(tuple)
static TransactionId HeapTupleHeaderGetRawXmin(const HeapTupleHeaderData *tup)
static void * GETSTRUCT(const HeapTupleData *tuple)
bool ItemPointerEquals(const ItemPointerData *pointer1, const ItemPointerData *pointer2)
char * MemoryContextStrdup(MemoryContext context, const char *string)
char * pstrdup(const char *in)
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)
FormData_pg_proc * Form_pg_proc
FormData_pg_type * Form_pg_type
PyObject * PLy_interp_globals
char * PLy_procedure_name(PLyProcedure *proc)
void init_procedure_caches(void)
static char * PLy_procedure_munge_source(const char *name, const char *src)
static PLyProcedure * PLy_procedure_create(HeapTuple procTup, Oid fn_oid, PLyTrigType is_trigger)
PLyProcedure * PLy_procedure_get(Oid fn_oid, Oid fn_rel, PLyTrigType is_trigger)
static bool PLy_procedure_valid(PLyProcedure *proc, HeapTuple procTup)
static HTAB * PLy_procedure_cache
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)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
Datum SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, AttrNumber attributeNumber)