|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "access/relation.h"#include "access/table.h"#include "catalog/catalog.h"#include "catalog/dependency.h"#include "catalog/indexing.h"#include "catalog/namespace.h"#include "catalog/objectaccess.h"#include "catalog/pg_namespace.h"#include "catalog/pg_statistic_ext.h"#include "catalog/pg_statistic_ext_data.h"#include "commands/comment.h"#include "commands/defrem.h"#include "miscadmin.h"#include "nodes/makefuncs.h"#include "nodes/nodeFuncs.h"#include "optimizer/optimizer.h"#include "statistics/statistics.h"#include "utils/acl.h"#include "utils/builtins.h"#include "utils/inval.h"#include "utils/lsyscache.h"#include "utils/rel.h"#include "utils/syscache.h"#include "utils/typcache.h"
Go to the source code of this file.
Functions | |
| static char * | ChooseExtendedStatisticName (const char *name1, const char *name2, const char *label, Oid namespaceid) |
| static char * | ChooseExtendedStatisticNameAddition (List *exprs) |
| static int | compare_int16 (const void *a, const void *b) |
| ObjectAddress | CreateStatistics (CreateStatsStmt *stmt, bool check_rights) |
| ObjectAddress | AlterStatistics (AlterStatsStmt *stmt) |
| void | RemoveStatisticsDataById (Oid statsOid, bool inh) |
| void | RemoveStatisticsById (Oid statsOid) |
| Oid | StatisticsGetRelation (Oid statId, bool missing_ok) |
| ObjectAddress AlterStatistics | ( | AlterStatsStmt * | stmt | ) |
Definition at line 669 of file statscmds.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, Assert, CatalogTupleUpdate(), DeconstructQualifiedName(), elog, ereport, errcode(), errmsg, ERROR, fb(), get_statistics_object_oid(), GetUserId(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, Int16GetDatum(), intVal, InvalidObjectAddress, InvokeObjectPostAlterHook, MAX_STATISTICS_TARGET, NameListToString(), NOTICE, object_ownercheck(), OBJECT_STATISTIC_EXT, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, RelationGetDescr, ReleaseSysCache(), RowExclusiveLock, SearchSysCache1(), stmt, table_close(), table_open(), and WARNING.
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 879 of file statscmds.c.
References fb(), GetSysCacheOid2, label, makeObjectName(), NAMEDATALEN, ObjectIdGetDatum(), OidIsValid, pfree(), PointerGetDatum, snprintf, and strlcpy().
Referenced by CreateStatistics().
Definition at line 921 of file statscmds.c.
References buf, fb(), IsA, lfirst, name, StatsElem::name, NAMEDATALEN, pstrdup(), and strlcpy().
Referenced by CreateStatistics().
Definition at line 51 of file statscmds.c.
References a, av, b, and fb().
Referenced by CreateStatistics().
| ObjectAddress CreateStatistics | ( | CreateStatsStmt * | stmt, |
| bool | check_rights | ||
| ) |
Definition at line 64 of file statscmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, allowSystemTableMods, Assert, attname, attnum, bms_next_member(), buildint2vector(), CacheInvalidateRelcache(), CatalogTupleInsert(), CharGetDatum(), ChooseExtendedStatisticName(), ChooseExtendedStatisticNameAddition(), compare_int16(), construct_array_builtin(), CreateComments(), CStringGetDatum(), CStringGetTextDatum, DEPENDENCY_AUTO, DEPENDENCY_NORMAL, equal(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errdetail(), errdetail_relkind_not_supported(), errmsg, ERROR, exprType(), fb(), FirstLowInvalidHeapAttributeNumber, format_type_be(), get_attgenerated(), get_attname(), get_namespace_name(), get_relkind_objtype(), GetNewOidWithIndex(), GETSTRUCT(), GetUserId(), heap_form_tuple(), heap_freetuple(), HeapTupleIsValid, i, InvalidObjectAddress, InvalidOid, InvokeObjectPostCreateHook, IsA, IsConflictLogTableClass(), IsSystemRelation(), lappend(), lengthof, lfirst, lfirst_node, list_length(), lookup_type_cache(), makeVar(), NameGetDatum(), namestrcpy(), NIL, nodeToString(), NoLock, NOTICE, object_aclcheck(), object_ownercheck(), OBJECT_SCHEMA, ObjectAddressSet, ObjectAddressSubSet, ObjectIdGetDatum(), pfree(), PointerGetDatum, pull_varattnos(), qsort, QualifiedNameGetCreationNamespace(), RelationData::rd_rel, recordDependencyOn(), recordDependencyOnOwner(), recordDependencyOnSingleRelExpr(), relation_close(), relation_openrv(), RelationGetNamespace, RelationGetRelationName, RelationGetRelid, ReleaseSysCache(), RowExclusiveLock, SearchSysCacheAttName(), SearchSysCacheExists2, ShareUpdateExclusiveLock, STATS_MAX_DIMENSIONS, stmt, strVal, table_open(), type, TYPECACHE_LT_OPR, types, values, and Var::varattno.
Referenced by ATExecAddStatistics(), and ProcessUtilitySlow().
Definition at line 817 of file statscmds.c.
References CacheInvalidateRelcacheByRelid(), CatalogTupleDelete(), elog, ERROR, fb(), Form_pg_statistic_ext, GETSTRUCT(), HeapTupleIsValid, NoLock, ObjectIdGetDatum(), ReleaseSysCache(), RemoveStatisticsDataById(), RowExclusiveLock, SearchSysCache1(), ShareUpdateExclusiveLock, table_close(), and table_open().
Referenced by doDeletion().
Definition at line 792 of file statscmds.c.
References BoolGetDatum(), CatalogTupleDelete(), fb(), HeapTupleIsValid, ObjectIdGetDatum(), ReleaseSysCache(), RowExclusiveLock, SearchSysCache2(), table_close(), and table_open().
Referenced by RemoveStatisticsById(), and statext_store().
Definition at line 968 of file statscmds.c.
References Assert, elog, ERROR, fb(), Form_pg_statistic_ext, GETSTRUCT(), HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), ReleaseSysCache(), result, and SearchSysCache1().
Referenced by ATPostAlterTypeCleanup().