|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "catalog/pg_proc.h"#include "commands/event_trigger.h"#include "commands/trigger.h"#include "common/hashfn.h"#include "funcapi.h"#include "utils/funccache.h"#include "utils/hsearch.h"#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
| struct | CachedFunctionHashEntry |
Macros | |
| #define | FUNCS_PER_USER 128 /* initial table size */ |
Typedefs | |
| typedef struct CachedFunctionHashEntry | CachedFunctionHashEntry |
Variables | |
| static HTAB * | cfunc_hashtable = NULL |
Definition at line 47 of file funccache.c.
| CachedFunction * cached_function_compile | ( | FunctionCallInfo | fcinfo, |
| CachedFunction * | function, | ||
| CachedFunctionCompileCallback | ccallback, | ||
| CachedFunctionDeleteCallback | dcallback, | ||
| Size | cacheEntrySize, | ||
| bool | includeResultType, | ||
| bool | forValidator | ||
| ) |
Definition at line 480 of file funccache.c.
References Assert, cfunc_hashtable_insert(), cfunc_hashtable_lookup(), compute_function_hashkey(), delete_function(), elog, ERROR, fb(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_oid, function, GETSTRUCT(), HeapTupleHeaderGetRawXmin(), HeapTupleIsValid, ItemPointerEquals(), MemoryContextAllocZero(), ObjectIdGetDatum(), pfree(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, ReleaseSysCache(), SearchSysCache1(), and TopMemoryContext.
Referenced by init_sql_fcache(), and plpgsql_compile().
Definition at line 85 of file funccache.c.
References CachedFunctionHashKey::argtypes, Assert, CachedFunctionHashKey::callResultType, DatumGetUInt32(), fb(), hash_any(), hash_combine(), hashRowType(), and CachedFunctionHashKey::nargs.
Referenced by cfunc_hashtable_init().
|
static |
Definition at line 207 of file funccache.c.
References cfunc_hashtable, elog, fb(), FreeTupleDesc(), function, HASH_REMOVE, hash_search(), and WARNING.
Referenced by delete_function().
Definition at line 59 of file funccache.c.
References Assert, cfunc_hash(), cfunc_hashtable, cfunc_match(), ctl, fb(), FUNCS_PER_USER, HASH_COMPARE, hash_create(), HASH_ELEM, and HASH_FUNCTION.
Referenced by cfunc_hashtable_insert().
|
static |
Definition at line 167 of file funccache.c.
References cfunc_hashtable, cfunc_hashtable_init(), CreateTupleDescCopy(), elog, fb(), function, HASH_ENTER, hash_search(), MemoryContextSwitchTo(), TopMemoryContext, and WARNING.
Referenced by cached_function_compile().
|
static |
Definition at line 146 of file funccache.c.
References cfunc_hashtable, fb(), CachedFunctionHashEntry::function, HASH_FIND, and hash_search().
Referenced by cached_function_compile().
Definition at line 109 of file funccache.c.
References Assert, equalRowTypes(), and fb().
Referenced by cfunc_hashtable_init().
| void cfunc_resolve_polymorphic_argtypes | ( | int | numargs, |
| Oid * | argtypes, | ||
| char * | argmodes, | ||
| Node * | call_expr, | ||
| bool | forValidator, | ||
| const char * | proname | ||
| ) |
Definition at line 348 of file funccache.c.
References ereport, errcode(), errmsg(), ERROR, fb(), get_call_expr_argtype(), i, OidIsValid, proname, and resolve_polymorphic_argtypes().
Referenced by compute_function_hashkey(), and plpgsql_compile_callback().
|
static |
Definition at line 247 of file funccache.c.
References CALLED_AS_EVENT_TRIGGER, CALLED_AS_TRIGGER, cfunc_resolve_polymorphic_argtypes(), FunctionCallInfoBaseData::context, fb(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_expr, FmgrInfo::fn_oid, FunctionCallInfoBaseData::fncollation, get_call_result_type(), NameStr, TriggerData::tg_trigger, Trigger::tgoid, TYPEFUNC_COMPOSITE, and TYPEFUNC_COMPOSITE_DOMAIN.
Referenced by cached_function_compile().
|
static |
Definition at line 433 of file funccache.c.
References cfunc_hashtable_delete(), CachedFunction::dcallback, fb(), and CachedFunction::use_count.
Referenced by cached_function_compile().
Definition at line 39 of file funccache.c.
Referenced by cfunc_hashtable_delete(), cfunc_hashtable_init(), cfunc_hashtable_insert(), and cfunc_hashtable_lookup().