105 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
140 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
141 errmsg(
"function with OID %u does not exist", func_id)));
145 if (pp->prokind != PROKIND_FUNCTION || pp->proretset)
147 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
148 errmsg(
"cannot call function \"%s\" via fastpath interface",
153 elog(
ERROR,
"function %s has more than %d arguments",
156 fip->namespace = pp->pronamespace;
158 memcpy(fip->
argtypes, pp->proargtypes.values, pp->pronargs *
sizeof(
Oid));
198 bool was_logged =
false;
207 (
errcode(ERRCODE_IN_FAILED_SQL_TRANSACTION),
208 errmsg(
"current transaction is aborted, "
209 "commands ignored until end of transaction block")));
233 (
errmsg(
"fastpath function call: \"%s\" (OID %u)",
276 for (
i = 0;
i < fcinfo->nargs;
i++)
278 if (fcinfo->args[
i].isnull)
293 fcinfo->isnull =
true;
312 (
errmsg(
"duration: %s ms", msec_str)));
316 (
errmsg(
"duration: %s ms fastpath function call: \"%s\" (OID %u)",
317 msec_str, fip->
fname, fid)));
335 int16 *aformats = NULL;
343 for (
i = 0;
i < numAFormats;
i++)
351 (
errcode(ERRCODE_PROTOCOL_VIOLATION),
352 errmsg(
"function call message contains %d arguments but function requires %d",
355 fcinfo->
nargs = nargs;
357 if (numAFormats > 1 && numAFormats != nargs)
359 (
errcode(ERRCODE_PROTOCOL_VIOLATION),
360 errmsg(
"function call message contains %d argument formats but %d arguments",
361 numAFormats, nargs)));
368 for (
i = 0;
i < nargs; ++
i)
383 (
errcode(ERRCODE_PROTOCOL_VIOLATION),
384 errmsg(
"invalid argument size %d in function call message",
395 aformat = aformats[
i];
396 else if (numAFormats > 0)
397 aformat = aformats[0];
423 if (pstring && pstring != abuf.
data)
426 else if (aformat == 1)
444 if (argsize != -1 && abuf.
cursor != abuf.
len)
446 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
447 errmsg(
"incorrect binary data format in function argument %d",
452 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
453 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)
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
char * get_func_name(Oid funcid)
char * get_namespace_name(Oid nspid)
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)