41#define DEFAULT_STATATT_NULL_FRAC Float4GetDatum(0.0)
42#define DEFAULT_STATATT_AVG_WIDTH Int32GetDatum(0)
44#define DEFAULT_STATATT_N_DISTINCT Float4GetDatum(0.0)
60 errmsg(
"argument \"%s\" must not be null",
87 errmsg(
"argument \"%s\" must not be a multidimensional array",
96 errmsg(
"argument \"%s\" array must not contain null values",
127 errmsg(
"argument \"%s\" must be specified when argument \"%s\" is specified",
190 errmsg(
"index \"%s\" was concurrently dropped",
205 errmsg(
"index \"%s\" was concurrently created",
215 switch (
form->relkind)
225 errmsg(
"cannot modify statistics for relation \"%s\"",
230 if (
form->relisshared)
233 errmsg(
"cannot modify statistics for shared relation")));
273 (
errmsg(
"unrecognized argument name: \"%s\"", argname)));
287 (
errmsg(
"argument \"%s\" has type %s, expected type %s",
331 if (rel->
rd_index->indkey.values[
i] == 0)
335 elog(
ERROR,
"too few entries in indexprs list");
372 errmsg(
"variadic arguments must be name/value pairs"),
373 errhint(
"Provide an even number of variadic arguments that can be divided into pairs."));
380 for (
int i = 0;
i < nargs;
i += 2)
387 (
errmsg(
"name at variadic position %d is null",
i + 1)));
391 (
errmsg(
"name at variadic position %d has type %s, expected type %s",
457 errmsg(
"column %d of relation \"%s\" does not exist",
462 if (attr->attisdropped)
465 errmsg(
"column %d of relation \"%s\" does not exist",
479 *atttypmod = attr->atttypmod;
504 *eq_opr = typcache->
eq_opr;
505 *lt_opr = typcache->
lt_opr;
585 fcinfo->args[0].isnull =
false;
587 fcinfo->args[1].isnull =
false;
589 fcinfo->args[2].isnull =
false;
607 errmsg(
"\"%s\" array must not contain null values",
staname)));
665 (
errmsg(
"maximum number of statistics slots exceeded: %d",
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(const ArrayType *array)
Datum array_in(PG_FUNCTION_ARGS)
static Datum values[MAXATTR]
#define TextDatumGetCString(d)
#define OidIsValid(objectId)
int errhint(const char *fmt,...)
void ThrowErrorData(ErrorData *edata)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define PG_GETARG_DATUM(n)
#define LOCAL_FCINFO(name, nargs)
#define FunctionCallInvoke(fcinfo)
int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start, bool convert_unknown, Datum **args, Oid **types, bool **nulls)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
Oid IndexGetRelation(Oid indexId, bool missing_ok)
void UnlockRelationOid(Oid relid, LOCKMODE lockmode)
void LockRelationOid(Oid relid, LOCKMODE lockmode)
#define ShareUpdateExclusiveLock
Oid get_multirange_range(Oid multirangeOid)
char get_rel_relkind(Oid relid)
Oid get_base_element_type(Oid typid)
bool type_is_multirange(Oid typid)
void pfree(void *pointer)
Oid exprType(const Node *expr)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
ObjectType get_relkind_objtype(char relkind)
FormData_pg_attribute * Form_pg_attribute
int errdetail_relkind_not_supported(char relkind)
FormData_pg_class * Form_pg_class
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
#define STATISTIC_NUM_SLOTS
int pg_strcasecmp(const char *s1, const char *s2)
static Oid DatumGetObjectId(Datum X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
static int16 DatumGetInt16(Datum X)
#define RelationGetRelationName(relation)
List * RelationGetIndexExpressions(Relation relation)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
#define DEFAULT_STATATT_NULL_FRAC
bool statatt_get_elem_type(Oid atttypid, char atttyptype, Oid *elemtypid, Oid *elem_eq_opr)
Datum statatt_build_stavalues(const char *staname, FmgrInfo *array_in, Datum d, Oid typid, int32 typmod, bool *ok)
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)
void RangeVarCallbackForStats(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)
void statatt_init_empty_tuple(Oid reloid, int16 attnum, bool inherited, Datum *values, bool *nulls, bool *replaces)
#define DEFAULT_STATATT_AVG_WIDTH
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 statatt_get_type(Oid reloid, AttrNumber attnum, Oid *atttypid, int32 *atttypmod, char *atttyptype, Oid *atttypcoll, Oid *eq_opr, Oid *lt_opr)
void stats_check_required_arg(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum)
static Node * statatt_get_index_expr(Relation rel, int attnum)
#define DEFAULT_STATATT_N_DISTINCT
void statatt_set_slot(Datum *values, bool *nulls, bool *replaces, int16 stakind, Oid staop, Oid stacoll, Datum stanumbers, bool stanumbers_isnull, Datum stavalues, bool stavalues_isnull)
bool stats_check_arg_pair(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum1, int argnum2)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)