59 bool ignore_security);
148 bool ignore_security)
176 finfo->
fn_oid = functionId;
183 elog(
ERROR,
"cache lookup failed for function %u", functionId);
186 finfo->
fn_nargs = procedureStruct->pronargs;
187 finfo->
fn_strict = procedureStruct->proisstrict;
188 finfo->
fn_retset = procedureStruct->proretset;
204 if (!ignore_security &&
205 (procedureStruct->prosecdef ||
211 finfo->
fn_oid = functionId;
216 switch (procedureStruct->prolang)
218 case INTERNALlanguageId:
230 Anum_pg_proc_prosrc);
235 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
236 errmsg(
"internal function \"%s\" is not in internal lookup table",
261 finfo->
fn_oid = functionId;
290 elog(
ERROR,
"cache lookup failed for function %u", functionId);
293 if (procedureStruct->prosecdef ||
304 switch (procedureStruct->prolang)
306 case INTERNALlanguageId:
308 Anum_pg_proc_prosrc);
316 Anum_pg_proc_prosrc);
319 Anum_pg_proc_probin);
378 Anum_pg_proc_prosrc);
382 Anum_pg_proc_probin);
407 elog(
ERROR,
"unrecognized function API version: %d",
421 Oid language = procedureStruct->prolang;
428 elog(
ERROR,
"cache lookup failed for language %u", language);
466 if (infofunc == NULL)
469 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
470 errmsg(
"could not find function information for function \"%s\"",
472 errhint(
"SQL-callable functions need an accompanying PG_FUNCTION_INFO_V1(funcname).")));
477 inforec = (*infofunc) ();
481 elog(
ERROR,
"null result from info function \"%s\"", infofuncname);
489 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
490 errmsg(
"unrecognized API version %d reported by info function \"%s\"",
583 memcpy(dstinfo, srcinfo,
sizeof(
FmgrInfo));
638 int save_sec_context;
642 volatile int save_nestlevel;
645 if (!fcinfo->flinfo->fn_extra)
657 fcinfo->flinfo->
fn_mcxt,
true);
663 elog(
ERROR,
"cache lookup failed for function %u",
664 fcinfo->flinfo->fn_oid);
667 if (procedureStruct->prosecdef)
668 fcache->
userid = procedureStruct->proowner;
697 fcinfo->flinfo->fn_extra = fcache;
738 save_flinfo = fcinfo->flinfo;
742 fcinfo->flinfo = &fcache->
flinfo;
754 (fcinfo->resultinfo == NULL ||
760 fcinfo->flinfo = save_flinfo;
767 fcinfo->flinfo = save_flinfo;
799 fcinfo->args[0].value = arg1;
800 fcinfo->args[0].isnull =
false;
802 result = (*func) (fcinfo);
806 elog(
ERROR,
"function %p returned NULL", (
void *) func);
819 fcinfo->args[0].value = arg1;
820 fcinfo->args[0].isnull =
false;
821 fcinfo->args[1].value = arg2;
822 fcinfo->args[1].isnull =
false;
824 result = (*func) (fcinfo);
828 elog(
ERROR,
"function %p returned NULL", (
void *) func);
842 fcinfo->args[0].value = arg1;
843 fcinfo->args[0].isnull =
false;
844 fcinfo->args[1].value = arg2;
845 fcinfo->args[1].isnull =
false;
846 fcinfo->args[2].value = arg3;
847 fcinfo->args[2].isnull =
false;
849 result = (*func) (fcinfo);
853 elog(
ERROR,
"function %p returned NULL", (
void *) func);
867 fcinfo->args[0].value = arg1;
868 fcinfo->args[0].isnull =
false;
869 fcinfo->args[1].value = arg2;
870 fcinfo->args[1].isnull =
false;
871 fcinfo->args[2].value = arg3;
872 fcinfo->args[2].isnull =
false;
873 fcinfo->args[3].value = arg4;
874 fcinfo->args[3].isnull =
false;
876 result = (*func) (fcinfo);
880 elog(
ERROR,
"function %p returned NULL", (
void *) func);
894 fcinfo->args[0].value = arg1;
895 fcinfo->args[0].isnull =
false;
896 fcinfo->args[1].value = arg2;
897 fcinfo->args[1].isnull =
false;
898 fcinfo->args[2].value = arg3;
899 fcinfo->args[2].isnull =
false;
900 fcinfo->args[3].value = arg4;
901 fcinfo->args[3].isnull =
false;
902 fcinfo->args[4].value = arg5;
903 fcinfo->args[4].isnull =
false;
905 result = (*func) (fcinfo);
909 elog(
ERROR,
"function %p returned NULL", (
void *) func);
924 fcinfo->args[0].value = arg1;
925 fcinfo->args[0].isnull =
false;
926 fcinfo->args[1].value = arg2;
927 fcinfo->args[1].isnull =
false;
928 fcinfo->args[2].value = arg3;
929 fcinfo->args[2].isnull =
false;
930 fcinfo->args[3].value = arg4;
931 fcinfo->args[3].isnull =
false;
932 fcinfo->args[4].value = arg5;
933 fcinfo->args[4].isnull =
false;
934 fcinfo->args[5].value = arg6;
935 fcinfo->args[5].isnull =
false;
937 result = (*func) (fcinfo);
941 elog(
ERROR,
"function %p returned NULL", (
void *) func);
956 fcinfo->args[0].value = arg1;
957 fcinfo->args[0].isnull =
false;
958 fcinfo->args[1].value = arg2;
959 fcinfo->args[1].isnull =
false;
960 fcinfo->args[2].value = arg3;
961 fcinfo->args[2].isnull =
false;
962 fcinfo->args[3].value = arg4;
963 fcinfo->args[3].isnull =
false;
964 fcinfo->args[4].value = arg5;
965 fcinfo->args[4].isnull =
false;
966 fcinfo->args[5].value = arg6;
967 fcinfo->args[5].isnull =
false;
968 fcinfo->args[6].value = arg7;
969 fcinfo->args[6].isnull =
false;
971 result = (*func) (fcinfo);
975 elog(
ERROR,
"function %p returned NULL", (
void *) func);
990 fcinfo->args[0].value = arg1;
991 fcinfo->args[0].isnull =
false;
992 fcinfo->args[1].value = arg2;
993 fcinfo->args[1].isnull =
false;
994 fcinfo->args[2].value = arg3;
995 fcinfo->args[2].isnull =
false;
996 fcinfo->args[3].value = arg4;
997 fcinfo->args[3].isnull =
false;
998 fcinfo->args[4].value = arg5;
999 fcinfo->args[4].isnull =
false;
1000 fcinfo->args[5].value = arg6;
1001 fcinfo->args[5].isnull =
false;
1002 fcinfo->args[6].value = arg7;
1003 fcinfo->args[6].isnull =
false;
1004 fcinfo->args[7].value = arg8;
1005 fcinfo->args[7].isnull =
false;
1007 result = (*func) (fcinfo);
1011 elog(
ERROR,
"function %p returned NULL", (
void *) func);
1027 fcinfo->args[0].value = arg1;
1028 fcinfo->args[0].isnull =
false;
1029 fcinfo->args[1].value = arg2;
1030 fcinfo->args[1].isnull =
false;
1031 fcinfo->args[2].value = arg3;
1032 fcinfo->args[2].isnull =
false;
1033 fcinfo->args[3].value = arg4;
1034 fcinfo->args[3].isnull =
false;
1035 fcinfo->args[4].value = arg5;
1036 fcinfo->args[4].isnull =
false;
1037 fcinfo->args[5].value = arg6;
1038 fcinfo->args[5].isnull =
false;
1039 fcinfo->args[6].value = arg7;
1040 fcinfo->args[6].isnull =
false;
1041 fcinfo->args[7].value = arg8;
1042 fcinfo->args[7].isnull =
false;
1043 fcinfo->args[8].value = arg9;
1044 fcinfo->args[8].isnull =
false;
1046 result = (*func) (fcinfo);
1050 elog(
ERROR,
"function %p returned NULL", (
void *) func);
1072 fcinfo->args[0].value = arg1;
1073 fcinfo->args[0].isnull =
false;
1075 result = (*func) (fcinfo);
1079 elog(
ERROR,
"function %p returned NULL", (
void *) func);
1092 fcinfo->args[0].value = arg1;
1093 fcinfo->args[0].isnull =
false;
1094 fcinfo->args[1].value = arg2;
1095 fcinfo->args[1].isnull =
false;
1097 result = (*func) (fcinfo);
1101 elog(
ERROR,
"function %p returned NULL", (
void *) func);
1136 fcinfo->args[0].value = arg1;
1137 fcinfo->args[0].isnull =
false;
1156 fcinfo->args[0].value = arg1;
1157 fcinfo->args[0].isnull =
false;
1158 fcinfo->args[1].value = arg2;
1159 fcinfo->args[1].isnull =
false;
1179 fcinfo->args[0].value = arg1;
1180 fcinfo->args[0].isnull =
false;
1181 fcinfo->args[1].value = arg2;
1182 fcinfo->args[1].isnull =
false;
1183 fcinfo->args[2].value = arg3;
1184 fcinfo->args[2].isnull =
false;
1204 fcinfo->args[0].value = arg1;
1205 fcinfo->args[0].isnull =
false;
1206 fcinfo->args[1].value = arg2;
1207 fcinfo->args[1].isnull =
false;
1208 fcinfo->args[2].value = arg3;
1209 fcinfo->args[2].isnull =
false;
1210 fcinfo->args[3].value = arg4;
1211 fcinfo->args[3].isnull =
false;
1231 fcinfo->args[0].value = arg1;
1232 fcinfo->args[0].isnull =
false;
1233 fcinfo->args[1].value = arg2;
1234 fcinfo->args[1].isnull =
false;
1235 fcinfo->args[2].value = arg3;
1236 fcinfo->args[2].isnull =
false;
1237 fcinfo->args[3].value = arg4;
1238 fcinfo->args[3].isnull =
false;
1239 fcinfo->args[4].value = arg5;
1240 fcinfo->args[4].isnull =
false;
1261 fcinfo->args[0].value = arg1;
1262 fcinfo->args[0].isnull =
false;
1263 fcinfo->args[1].value = arg2;
1264 fcinfo->args[1].isnull =
false;
1265 fcinfo->args[2].value = arg3;
1266 fcinfo->args[2].isnull =
false;
1267 fcinfo->args[3].value = arg4;
1268 fcinfo->args[3].isnull =
false;
1269 fcinfo->args[4].value = arg5;
1270 fcinfo->args[4].isnull =
false;
1271 fcinfo->args[5].value = arg6;
1272 fcinfo->args[5].isnull =
false;
1293 fcinfo->args[0].value = arg1;
1294 fcinfo->args[0].isnull =
false;
1295 fcinfo->args[1].value = arg2;
1296 fcinfo->args[1].isnull =
false;
1297 fcinfo->args[2].value = arg3;
1298 fcinfo->args[2].isnull =
false;
1299 fcinfo->args[3].value = arg4;
1300 fcinfo->args[3].isnull =
false;
1301 fcinfo->args[4].value = arg5;
1302 fcinfo->args[4].isnull =
false;
1303 fcinfo->args[5].value = arg6;
1304 fcinfo->args[5].isnull =
false;
1305 fcinfo->args[6].value = arg7;
1306 fcinfo->args[6].isnull =
false;
1327 fcinfo->args[0].value = arg1;
1328 fcinfo->args[0].isnull =
false;
1329 fcinfo->args[1].value = arg2;
1330 fcinfo->args[1].isnull =
false;
1331 fcinfo->args[2].value = arg3;
1332 fcinfo->args[2].isnull =
false;
1333 fcinfo->args[3].value = arg4;
1334 fcinfo->args[3].isnull =
false;
1335 fcinfo->args[4].value = arg5;
1336 fcinfo->args[4].isnull =
false;
1337 fcinfo->args[5].value = arg6;
1338 fcinfo->args[5].isnull =
false;
1339 fcinfo->args[6].value = arg7;
1340 fcinfo->args[6].isnull =
false;
1341 fcinfo->args[7].value = arg8;
1342 fcinfo->args[7].isnull =
false;
1364 fcinfo->args[0].value = arg1;
1365 fcinfo->args[0].isnull =
false;
1366 fcinfo->args[1].value = arg2;
1367 fcinfo->args[1].isnull =
false;
1368 fcinfo->args[2].value = arg3;
1369 fcinfo->args[2].isnull =
false;
1370 fcinfo->args[3].value = arg4;
1371 fcinfo->args[3].isnull =
false;
1372 fcinfo->args[4].value = arg5;
1373 fcinfo->args[4].isnull =
false;
1374 fcinfo->args[5].value = arg6;
1375 fcinfo->args[5].isnull =
false;
1376 fcinfo->args[6].value = arg7;
1377 fcinfo->args[6].isnull =
false;
1378 fcinfo->args[7].value = arg8;
1379 fcinfo->args[7].isnull =
false;
1380 fcinfo->args[8].value = arg9;
1381 fcinfo->args[8].isnull =
false;
1513 arg6, arg7, arg8, arg9);
1541 fcinfo->args[0].isnull =
false;
1543 fcinfo->args[1].isnull =
false;
1545 fcinfo->args[2].isnull =
false;
1552 if (!fcinfo->isnull)
1553 elog(
ERROR,
"input function %u returned non-NULL",
1559 elog(
ERROR,
"input function %u returned NULL",
1594 *result = (
Datum) 0;
1601 fcinfo->args[0].isnull =
false;
1603 fcinfo->args[1].isnull =
false;
1605 fcinfo->args[2].isnull =
false;
1616 if (!fcinfo->isnull)
1617 elog(
ERROR,
"input function %u returned non-NULL",
1623 elog(
ERROR,
"input function %u returned NULL",
1649 *result = (
Datum) 0;
1656 fcinfo->args[0].isnull =
false;
1658 fcinfo->args[1].isnull =
false;
1660 fcinfo->args[2].isnull =
false;
1662 *result = (*func) (fcinfo);
1670 elog(
ERROR,
"input function %p returned NULL", (
void *) func);
1709 fcinfo->args[0].isnull =
false;
1711 fcinfo->args[1].isnull =
false;
1713 fcinfo->args[2].isnull =
false;
1720 if (!fcinfo->isnull)
1721 elog(
ERROR,
"receive function %u returned non-NULL",
1727 elog(
ERROR,
"receive function %u returned NULL",
1804 #ifndef USE_FLOAT8_BYVAL
1851 memcpy(result, datum,
len);
1896 if (!flinfo || !flinfo->
fn_expr)
1916 if (!flinfo || !flinfo->
fn_expr)
1981 if (!flinfo || !flinfo->
fn_expr)
2052 if (!flinfo || !flinfo->
fn_expr)
2058 return ((
FuncExpr *) expr)->funcvariadic;
2088 return !expr->constisnull;
2104 return expr->constisnull ? NULL :
DatumGetByteaP(expr->constvalue);
2108 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2109 errmsg(
"operator class options info is absent in function call context")));
2160 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
2161 errmsg(
"function with OID %u does not exist", functionOid)));
2170 elog(
ERROR,
"cache lookup failed for language %u", procStruct->prolang);
2173 if (langStruct->lanvalidator != validatorOid)
2175 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
2176 errmsg(
"language validation function %u called for language %u instead of %u",
2177 validatorOid, procStruct->prolang,
2178 langStruct->lanvalidator)));
2185 NameStr(langStruct->lanname));
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
#define DatumGetArrayTypeP(X)
#define TextDatumGetCString(d)
#define OidIsValid(objectId)
struct varlena * detoast_attr(struct varlena *attr)
struct varlena * detoast_attr_slice(struct varlena *attr, int32 sliceoffset, int32 slicelength)
void * load_external_function(const char *filename, const char *funcname, bool signalNotFound, void **filehandle)
void * lookup_external_function(void *filehandle, const char *funcname)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
Datum FunctionCall4Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4)
Datum OidFunctionCall2Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2)
void set_fn_opclass_options(FmgrInfo *flinfo, bytea *options)
Oid fmgr_internal_function(const char *proname)
struct varlena * pg_detoast_datum_packed(struct varlena *datum)
Datum OidFunctionCall9Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8, Datum arg9)
bool get_fn_expr_arg_stable(FmgrInfo *flinfo, int argnum)
Datum OidFunctionCall6Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6)
Datum FunctionCall6Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6)
Datum OidFunctionCall5Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5)
Datum FunctionCall8Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8)
struct varlena * pg_detoast_datum_copy(struct varlena *datum)
bool CheckFunctionValidatorAccess(Oid validatorOid, Oid functionOid)
Datum OidReceiveFunctionCall(Oid functionId, StringInfo buf, Oid typioparam, int32 typmod)
bytea * get_fn_opclass_options(FmgrInfo *flinfo)
Datum InputFunctionCall(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod)
Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
const Pg_finfo_record * fetch_finfo_record(void *filehandle, const char *funcname)
PGDLLIMPORT needs_fmgr_hook_type needs_fmgr_hook
Datum DirectFunctionCall2Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2)
static void fmgr_info_C_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
Datum FunctionCall5Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5)
static void fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
Datum OidFunctionCall3Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3)
void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
Datum Int64GetDatum(int64 X)
Datum OidFunctionCall8Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8)
Datum OidFunctionCall4Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4)
Datum DirectFunctionCall4Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4)
static const FmgrBuiltin * fmgr_isbuiltin(Oid id)
Datum OidFunctionCall7Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7)
PGDLLIMPORT fmgr_hook_type fmgr_hook
bool InputFunctionCallSafe(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod, fmNodePtr escontext, Datum *result)
Datum Float8GetDatum(float8 X)
bool has_fn_opclass_options(FmgrInfo *flinfo)
Datum CallerFInfoFunctionCall2(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
Datum CallerFInfoFunctionCall1(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1)
Datum DirectFunctionCall6Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6)
char * OidOutputFunctionCall(Oid functionId, Datum val)
Datum DirectFunctionCall5Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5)
Datum OidFunctionCall1Coll(Oid functionId, Oid collation, Datum arg1)
static const FmgrBuiltin * fmgr_lookupByName(const char *name)
struct varlena * pg_detoast_datum_slice(struct varlena *datum, int32 first, int32 count)
bool get_fn_expr_variadic(FmgrInfo *flinfo)
Datum DirectFunctionCall1Coll(PGFunction func, Oid collation, Datum arg1)
Datum FunctionCall3Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3)
Datum DirectFunctionCall3Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3)
Oid get_call_expr_argtype(Node *expr, int argnum)
Datum FunctionCall7Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7)
Oid get_fn_expr_argtype(FmgrInfo *flinfo, int argnum)
Datum OidFunctionCall0Coll(Oid functionId, Oid collation)
void fmgr_symbol(Oid functionId, char **mod, char **fn)
Datum DirectFunctionCall9Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8, Datum arg9)
bytea * SendFunctionCall(FmgrInfo *flinfo, Datum val)
Datum FunctionCall1Coll(FmgrInfo *flinfo, Oid collation, Datum arg1)
Datum fmgr_security_definer(PG_FUNCTION_ARGS)
bool DirectInputFunctionCallSafe(PGFunction func, char *str, Oid typioparam, int32 typmod, fmNodePtr escontext, Datum *result)
bytea * OidSendFunctionCall(Oid functionId, Datum val)
Oid get_fn_expr_rettype(FmgrInfo *flinfo)
char * OutputFunctionCall(FmgrInfo *flinfo, Datum val)
void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, MemoryContext destcxt)
static void record_C_func(HeapTuple procedureTuple, PGFunction user_fn, const Pg_finfo_record *inforec)
static void fmgr_info_cxt_security(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt, bool ignore_security)
Datum FunctionCall0Coll(FmgrInfo *flinfo, Oid collation)
Datum FunctionCall9Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8, Datum arg9)
struct varlena * pg_detoast_datum(struct varlena *datum)
Datum DirectFunctionCall7Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7)
static CFuncHashTabEntry * lookup_C_func(HeapTuple procedureTuple)
bool get_call_expr_arg_stable(Node *expr, int argnum)
Datum ReceiveFunctionCall(FmgrInfo *flinfo, StringInfo buf, Oid typioparam, int32 typmod)
Datum DirectFunctionCall8Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8)
bool(* needs_fmgr_hook_type)(Oid fn_oid)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define LOCAL_FCINFO(name, nargs)
#define FunctionCall1(flinfo, arg1)
#define FunctionCallInvoke(fcinfo)
const Pg_finfo_record *(* PGFInfoFunction)(void)
void(* fmgr_hook_type)(FmgrHookEventType event, FmgrInfo *flinfo, Datum *arg)
Datum(* PGFunction)(FunctionCallInfo fcinfo)
#define FmgrHookIsNeeded(fn_oid)
#define DatumGetByteaP(X)
PGDLLIMPORT const Oid fmgr_last_builtin_oid
PGDLLIMPORT const int fmgr_nbuiltins
PGDLLIMPORT const FmgrBuiltin fmgr_builtins[]
#define InvalidOidBuiltinMapping
PGDLLIMPORT const uint16 fmgr_builtin_oid_index[]
Datum fmgr_sql(PG_FUNCTION_ARGS)
int NewGUCNestLevel(void)
config_handle * get_config_handle(const char *name)
int set_config_with_handle(const char *name, config_handle *handle, const char *value, GucContext context, GucSource source, Oid srole, GucAction action, bool changeVal, int elevel, bool is_reload)
void TransformGUCArray(ArrayType *array, List **names, List **values)
void AtEOXact_GUC(bool isCommit, int nestLevel)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
#define HeapTupleIsValid(tuple)
#define HeapTupleHeaderGetRawXmin(tup)
if(TABLE==NULL||TABLE_index==NULL)
bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2)
List * lappend(List *list, void *datum)
Oid get_base_element_type(Oid typid)
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * MemoryContextAllocZero(MemoryContext context, Size size)
MemoryContext CurrentMemoryContext
#define SECURITY_LOCAL_USERID_CHANGE
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
void SetUserIdAndSecContext(Oid userid, int sec_context)
#define SOFT_ERROR_OCCURRED(escontext)
Oid exprType(const Node *expr)
#define IsA(nodeptr, _type_)
FormData_pg_language * Form_pg_language
static int list_length(const List *l)
#define forthree(cell1, list1, cell2, list2, cell3, list3)
static void * list_nth(const List *list, int n)
FormData_pg_proc * Form_pg_proc
static rewind_source * source
void pgstat_init_function_usage(FunctionCallInfo fcinfo, PgStat_FunctionCallUsage *fcu)
void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize)
static Datum PointerGetDatum(const void *X)
static char * DatumGetCString(Datum X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
char * psprintf(const char *fmt,...)
MemoryContextSwitchTo(old_ctx)
const Pg_finfo_record * inforec
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)
static void * fn(void *arg)
#define VARATT_IS_EXTENDED(PTR)
#define VARATT_IS_COMPRESSED(PTR)
#define VARATT_IS_EXTERNAL(PTR)