PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/relation.h"
#include "catalog/index.h"
#include "catalog/namespace.h"
#include "catalog/pg_database.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "statistics/stat_utils.h"
#include "storage/lmgr.h"
#include "utils/acl.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
Go to the source code of this file.
Functions | |
void | stats_check_required_arg (FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum) |
bool | stats_check_arg_array (FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum) |
bool | stats_check_arg_pair (FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum1, int argnum2) |
void | stats_lock_check_privileges (Oid reloid) |
Oid | stats_lookup_relid (const char *nspname, const char *relname) |
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_fill_fcinfo_from_arg_pairs (FunctionCallInfo pairs_fcinfo, FunctionCallInfo positional_fcinfo, struct StatsArgInfo *arginfo) |
|
static |
Definition at line 243 of file stat_utils.c.
References StatsArgInfo::argname, ereport, errmsg(), pg_strcasecmp(), and WARNING.
Referenced by stats_fill_fcinfo_from_arg_pairs().
bool stats_check_arg_array | ( | FunctionCallInfo | fcinfo, |
struct StatsArgInfo * | arginfo, | ||
int | argnum | ||
) |
Definition at line 56 of file stat_utils.c.
References ARR_NDIM, array_contains_nulls(), DatumGetArrayTypeP, ereport, errcode(), errmsg(), PG_ARGISNULL, PG_GETARG_DATUM, and WARNING.
Referenced by attribute_statistics_update().
bool stats_check_arg_pair | ( | FunctionCallInfo | fcinfo, |
struct StatsArgInfo * | arginfo, | ||
int | argnum1, | ||
int | argnum2 | ||
) |
Definition at line 97 of file stat_utils.c.
References ereport, errcode(), errmsg(), PG_ARGISNULL, and WARNING.
Referenced by attribute_statistics_update().
Definition at line 261 of file stat_utils.c.
References ereport, errmsg(), format_type_be(), and WARNING.
Referenced by stats_fill_fcinfo_from_arg_pairs().
void stats_check_required_arg | ( | FunctionCallInfo | fcinfo, |
struct StatsArgInfo * | arginfo, | ||
int | argnum | ||
) |
Definition at line 37 of file stat_utils.c.
References ereport, errcode(), errmsg(), ERROR, and PG_ARGISNULL.
Referenced by attribute_statistics_update(), pg_clear_attribute_stats(), and relation_statistics_update().
bool stats_fill_fcinfo_from_arg_pairs | ( | FunctionCallInfo | pairs_fcinfo, |
FunctionCallInfo | positional_fcinfo, | ||
struct StatsArgInfo * | arginfo | ||
) |
Definition at line 285 of file stat_utils.c.
References StatsArgInfo::argname, generate_unaccent_rules::args, FunctionCallInfoBaseData::args, ereport, errhint(), errmsg(), ERROR, extract_variadic_args(), format_type_be(), get_arg_by_name(), i, NullableDatum::isnull, pg_strcasecmp(), stats_check_arg_type(), TextDatumGetCString, types, and NullableDatum::value.
Referenced by pg_restore_attribute_stats(), and pg_restore_relation_stats().
void stats_lock_check_privileges | ( | Oid | reloid | ) |
Definition at line 131 of file stat_utils.c.
References AccessShareLock, ACL_MAINTAIN, aclcheck_error(), ACLCHECK_OK, Assert(), ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, get_rel_relkind(), get_relkind_objtype(), GetUserId(), IndexGetRelation(), InvalidOid, MyDatabaseId, NameStr, NoLock, object_ownercheck(), OidIsValid, pg_class_aclcheck(), relation_close(), relation_open(), RelationGetRelationName, RelationGetRelid, ShareUpdateExclusiveLock, and table.
Referenced by attribute_statistics_update(), pg_clear_attribute_stats(), and relation_statistics_update().
Oid stats_lookup_relid | ( | const char * | nspname, |
const char * | relname | ||
) |
Definition at line 221 of file stat_utils.c.
References ereport, errcode(), ERRCODE_UNDEFINED_TABLE, errmsg(), ERROR, get_relname_relid(), LookupExplicitNamespace(), OidIsValid, and relname.
Referenced by attribute_statistics_update(), pg_clear_attribute_stats(), and relation_statistics_update().