42 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
43 errmsg(
"\"%s\" cannot be NULL",
44 arginfo[argnum].argname)));
69 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
70 errmsg(
"\"%s\" cannot be a multidimensional array",
71 arginfo[argnum].argname)));
78 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
79 errmsg(
"\"%s\" array cannot contain NULL values",
80 arginfo[argnum].argname)));
98 int argnum1,
int argnum2)
105 int nullarg =
PG_ARGISNULL(argnum1) ? argnum1 : argnum2;
106 int otherarg =
PG_ARGISNULL(argnum1) ? argnum2 : argnum1;
109 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
110 errmsg(
"\"%s\" must be specified when \"%s\" is specified",
111 arginfo[nullarg].argname,
112 arginfo[otherarg].argname)));
133 Oid table_oid = reloid;
155 case RELKIND_PARTITIONED_INDEX:
167 switch (table->
rd_rel->relkind)
169 case RELKIND_RELATION:
170 case RELKIND_MATVIEW:
171 case RELKIND_FOREIGN_TABLE:
172 case RELKIND_PARTITIONED_TABLE:
176 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
177 errmsg(
"cannot modify statistics for relation \"%s\"",
195 if (table->
rd_rel->relisshared)
197 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
198 errmsg(
"cannot modify statistics for shared relation")));
225 for (argnum = 0; arginfo[argnum].
argname != NULL; argnum++)
230 (
errmsg(
"unrecognized argument name: \"%s\"", argname)));
241 if (argtype != expectedtype)
244 (
errmsg(
"argument \"%s\" has type \"%s\", expected type \"%s\"",
274 for (
int i = 0; arginfo[
i].
argname != NULL;
i++)
285 errmsg(
"variadic arguments must be name/value pairs"),
286 errhint(
"Provide an even number of variadic arguments that can be divided into pairs."));
293 for (
int i = 0;
i < nargs;
i += 2)
300 (
errmsg(
"name at variadic position %d is NULL",
i + 1)));
304 (
errmsg(
"name at variadic position %d has type \"%s\", expected type \"%s\"",
326 arginfo[argnum].argtype))
333 positional_fcinfo->
args[argnum].
isnull =
false;
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
#define DatumGetArrayTypeP(X)
bool array_contains_nulls(ArrayType *array)
#define TextDatumGetCString(d)
#define OidIsValid(objectId)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_DATUM(n)
int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start, bool convert_unknown, Datum **args, Oid **types, bool **nulls)
Assert(PointerIsAligned(start, uint64))
Oid IndexGetRelation(Oid indexId, bool missing_ok)
#define ShareUpdateExclusiveLock
char get_rel_relkind(Oid relid)
ObjectType get_relkind_objtype(char relkind)
int errdetail_relkind_not_supported(char relkind)
int pg_strcasecmp(const char *s1, const char *s2)
#define RelationGetRelid(relation)
#define RelationGetRelationName(relation)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
bool stats_fill_fcinfo_from_arg_pairs(FunctionCallInfo pairs_fcinfo, FunctionCallInfo positional_fcinfo, struct StatsArgInfo *arginfo)
static int get_arg_by_name(const char *argname, struct StatsArgInfo *arginfo)
static bool stats_check_arg_type(const char *argname, Oid argtype, Oid expectedtype)
bool stats_check_arg_array(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum)
void stats_check_required_arg(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum)
void stats_lock_check_privileges(Oid reloid)
bool stats_check_arg_pair(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum1, int argnum2)
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]