106 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
141 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
142 errmsg(
"function with OID %u does not exist", func_id)));
146 if (pp->prokind != PROKIND_FUNCTION || pp->proretset)
148 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
149 errmsg(
"cannot call function \"%s\" via fastpath interface",
154 elog(
ERROR,
"function %s has more than %d arguments",
157 fip->namespace = pp->pronamespace;
159 memcpy(fip->
argtypes, pp->proargtypes.values, pp->pronargs *
sizeof(
Oid));
199 bool was_logged =
false;
208 (
errcode(ERRCODE_IN_FAILED_SQL_TRANSACTION),
209 errmsg(
"current transaction is aborted, "
210 "commands ignored until end of transaction block")));
234 (
errmsg(
"fastpath function call: \"%s\" (OID %u)",
277 for (
i = 0;
i < fcinfo->nargs;
i++)
279 if (fcinfo->args[
i].isnull)
294 fcinfo->isnull =
true;
313 (
errmsg(
"duration: %s ms", msec_str)));
317 (
errmsg(
"duration: %s ms fastpath function call: \"%s\" (OID %u)",
318 msec_str, fip->
fname, fid)));
336 int16 *aformats = NULL;
344 for (
i = 0;
i < numAFormats;
i++)
352 (
errcode(ERRCODE_PROTOCOL_VIOLATION),
353 errmsg(
"function call message contains %d arguments but function requires %d",
356 fcinfo->
nargs = nargs;
358 if (numAFormats > 1 && numAFormats != nargs)
360 (
errcode(ERRCODE_PROTOCOL_VIOLATION),
361 errmsg(
"function call message contains %d argument formats but %d arguments",
362 numAFormats, nargs)));
369 for (
i = 0;
i < nargs; ++
i)
384 (
errcode(ERRCODE_PROTOCOL_VIOLATION),
385 errmsg(
"invalid argument size %d in function call message",
396 aformat = aformats[
i];
397 else if (numAFormats > 0)
398 aformat = aformats[0];
424 if (pstring && pstring != abuf.
data)
427 else if (aformat == 1)
445 if (argsize != -1 && abuf.
cursor != abuf.
len)
447 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
448 errmsg(
"incorrect binary data format in function argument %d",
453 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
454 errmsg(
"unsupported format code: %d", aformat)));
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
#define Assert(condition)
#define MemSet(start, val, len)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static void fetch_fp_info(Oid func_id, struct fp_info *fip)
static int16 parse_fcall_arguments(StringInfo msgBuf, struct fp_info *fip, FunctionCallInfo fcinfo)
static void SendFunctionResult(Datum retval, bool isnull, Oid rettype, int16 format)
void HandleFunctionRequest(StringInfo msgBuf)
Datum OidReceiveFunctionCall(Oid functionId, StringInfo buf, Oid typioparam, int32 typmod)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
char * OidOutputFunctionCall(Oid functionId, Datum val)
bytea * OidSendFunctionCall(Oid functionId, Datum val)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define LOCAL_FCINFO(name, nargs)
#define FunctionCallInvoke(fcinfo)
#define HeapTupleIsValid(tuple)
void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena)
char * get_namespace_name(Oid nspid)
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
char * get_func_name(Oid funcid)
void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam)
char * pg_client_to_server(const char *s, int len)
void pfree(void *pointer)
#define CHECK_FOR_INTERRUPTS()
#define InvokeNamespaceSearchHook(objectId, ereport_on_violation)
#define InvokeFunctionExecuteHook(objectId)
FormData_pg_proc * Form_pg_proc
size_t strlcpy(char *dst, const char *src, size_t siz)
int check_log_duration(char *msec_str, bool was_logged)
static Datum ObjectIdGetDatum(Oid X)
#define PqMsg_FunctionCallResponse
Snapshot GetTransactionSnapshot(void)
void PushActiveSnapshot(Snapshot snapshot)
void PopActiveSnapshot(void)
void resetStringInfo(StringInfo str)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void initStringInfo(StringInfo str)
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]
Oid argtypes[FUNC_MAX_ARGS]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
bool IsAbortedTransactionBlockState(void)