39 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
40 errmsg(
"\"%s\" cannot be NULL",
41 arginfo[argnum].argname)));
54 int argnum,
int elevel)
66 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
67 errmsg(
"\"%s\" cannot be a multidimensional array",
68 arginfo[argnum].argname)));
75 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
76 errmsg(
"\"%s\" array cannot contain NULL values",
77 arginfo[argnum].argname)));
95 int argnum1,
int argnum2,
int elevel)
102 int nullarg =
PG_ARGISNULL(argnum1) ? argnum1 : argnum2;
103 int otherarg =
PG_ARGISNULL(argnum1) ? argnum2 : argnum1;
106 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
107 errmsg(
"\"%s\" must be specified when \"%s\" is specified",
108 arginfo[nullarg].argname,
109 arginfo[otherarg].argname)));
130 const char relkind = rel->
rd_rel->relkind;
135 case RELKIND_RELATION:
137 case RELKIND_MATVIEW:
138 case RELKIND_FOREIGN_TABLE:
139 case RELKIND_PARTITIONED_TABLE:
140 case RELKIND_PARTITIONED_INDEX:
144 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
145 errmsg(
"cannot modify statistics for relation \"%s\"",
150 if (rel->
rd_rel->relisshared)
152 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
153 errmsg(
"cannot modify statistics for shared relation")));
179 for (argnum = 0; arginfo[argnum].
argname != NULL; argnum++)
184 (
errmsg(
"unrecognized argument name: \"%s\"", argname)));
195 if (argtype != expectedtype)
198 (
errmsg(
"argument \"%s\" has type \"%s\", expected type \"%s\"",
229 for (
int i = 0; arginfo[
i].
argname != NULL;
i++)
240 errmsg(
"variadic arguments must be name/value pairs"),
241 errhint(
"Provide an even number of variadic arguments that can be divided into pairs."));
248 for (
int i = 0;
i < nargs;
i += 2)
255 (
errmsg(
"name at variadic position %d is NULL",
i + 1)));
259 (
errmsg(
"name at variadic position %d has type \"%s\", expected type \"%s\"",
281 arginfo[argnum].argtype,
289 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)
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)
#define ShareUpdateExclusiveLock
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_check_arg_array(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum, int elevel)
static int get_arg_by_name(const char *argname, struct StatsArgInfo *arginfo, int elevel)
void stats_check_required_arg(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum)
bool stats_fill_fcinfo_from_arg_pairs(FunctionCallInfo pairs_fcinfo, FunctionCallInfo positional_fcinfo, struct StatsArgInfo *arginfo, int elevel)
bool stats_check_arg_pair(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum1, int argnum2, int elevel)
void stats_lock_check_privileges(Oid reloid)
static bool stats_check_arg_type(const char *argname, Oid argtype, Oid expectedtype, int elevel)
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]