63#include "utils/fmgroids.h"
100 bool iswithoutoverlaps,
106 bool primary,
bool isconstraint);
226 isconstraint =
false;
237 errmsg(
"access method \"%s\" does not exist",
245 amsummarizing =
amRoutine->amsummarizing;
382 for (
i = 0;
i < natts;
i++)
617 if (
stmt->reset_default_tblspc)
667 stmt->indexIncludingParams);
673 errmsg(
"must specify at least one column")));
677 errmsg(
"cannot use more than %d columns in an index",
716 switch (rel->
rd_rel->relkind)
726 errmsg(
"cannot create index on relation \"%s\"",
749 if (
stmt->concurrent)
752 errmsg(
"cannot create index on partitioned table \"%s\" concurrently",
762 errmsg(
"cannot create indexes on temporary tables of other sessions")));
794 if (
stmt->tableSpace)
800 errmsg(
"cannot specify default tablespace for partitioned relations")));
827 if (rel->
rd_rel->relisshared)
832 errmsg(
"only shared relations can be placed in pg_global tablespace")));
847 stmt->excludeOpNames,
865 (
errmsg(
"substituting access method \"gist\" for obsolete method \"rtree\"")));
873 errmsg(
"access method \"%s\" does not exist",
886 errmsg(
"access method \"%s\" does not support unique indexes",
891 errmsg(
"access method \"%s\" does not support included columns",
896 errmsg(
"access method \"%s\" does not support multicolumn indexes",
901 errmsg(
"access method \"%s\" does not support exclusion constraints",
906 errmsg(
"access method \"%s\" does not support WITHOUT OVERLAPS constraints",
918 if (
stmt->whereClause)
940 stmt->nulls_not_distinct,
944 stmt->iswithoutoverlaps);
957 amcanorder,
stmt->isconstraint,
stmt->iswithoutoverlaps,
985 else if (
stmt->unique)
987 else if (
stmt->excludeOpNames)
999 for (
i = 0;
i < key->partnatts;
i++)
1018 key->partopcintype[
i],
1019 key->partopcintype[
i],
1022 elog(
ERROR,
"missing operator %d(%u,%u) in partition opfamily %u",
1024 key->partopfamily[
i]);
1030 if (key->partattrs[
i] == 0)
1033 errmsg(
"unsupported %s constraint with partition key definition",
1035 errdetail(
"%s constraints cannot be used when partition keys include expressions.",
1059 if (
stmt->unique && !
stmt->iswithoutoverlaps)
1071 errdetail(
"There is no suitable operator in operator family \"%s\" for access method \"%s\".",
1091 errmsg(
"cannot match partition key to index on column \"%s\" using non-equal operator \"%s\"",
1104 key->partattrs[
i] - 1);
1108 errmsg(
"%s constraint on partitioned table must include all partitioning columns",
1111 errdetail(
"%s constraint on table \"%s\" lacks column \"%s\" which is part of the partition key.",
1133 errmsg(
"index creation on system columns is not supported")));
1141 errmsg(
"primary keys on virtual generated columns are not supported") :
1142 stmt->isconstraint ?
1143 errmsg(
"unique constraints on virtual generated columns are not supported") :
1144 errmsg(
"indexes on virtual generated columns are not supported"));
1165 errmsg(
"index creation on system columns is not supported")));
1182 stmt->isconstraint ?
1183 errmsg(
"unique constraints on virtual generated columns are not supported") :
1184 errmsg(
"indexes on virtual generated columns are not supported")));
1196 if (
stmt->isconstraint && !quiet)
1202 else if (
stmt->unique)
1204 else if (
stmt->excludeOpNames)
1213 (
errmsg_internal(
"%s %s will create implicit index \"%s\" for table \"%s\"",
1232 if (
stmt->isconstraint)
1236 if (
stmt->if_not_exists)
1257 if (
stmt->deferrable)
1259 if (
stmt->initdeferred)
1261 if (
stmt->iswithoutoverlaps)
1322 if ((!
stmt->relation ||
stmt->relation->inh) && partdesc->
nparts > 0)
1324 int nparts = partdesc->
nparts;
1385 for (
int i = 0;
i < nparts;
i++)
1416 errmsg(
"cannot create unique index on partitioned table \"%s\"",
1418 errdetail(
"Table \"%s\" contains partitions that are foreign tables.",
1483 if (!
cldidx->rd_index->indisvalid)
1581 elog(
ERROR,
"cache lookup failed for index %u",
1878 errmsg(
"functions in index predicate must be marked IMMUTABLE")));
1905 bool iswithoutoverlaps,
1915 int save_sec_context;
1935 if (iswithoutoverlaps)
1976 errmsg(
"column \"%s\" named in key does not exist",
1982 errmsg(
"column \"%s\" does not exist",
1989 attcollation =
attform->attcollation;
2002 errmsg(
"expressions are not supported in included columns"),
2044 errmsg(
"functions in index expression must be marked IMMUTABLE"),
2060 errmsg(
"including column does not support a collation"),
2065 errmsg(
"including column does not support an operator class"),
2070 errmsg(
"including column does not support ASC/DESC options"),
2075 errmsg(
"including column does not support NULLS FIRST/LAST options"),
2119 errmsg(
"could not determine which collation to use for index expression"),
2120 errhint(
"Use the COLLATE clause to set the collation explicitly."),
2128 errmsg(
"collations are not supported by type %s",
2196 errmsg(
"operator %s is not commutative",
2198 errdetail(
"Only commutative operators can be used in exclusion constraints."),
2209 errmsg(
"operator %s is not a member of operator family \"%s\"",
2212 errdetail(
"The exclusion operator must be related to the index operator class for the constraint."),
2220 else if (iswithoutoverlaps)
2262 errmsg(
"access method \"%s\" does not support ASC/DESC options",
2268 errmsg(
"access method \"%s\" does not support NULLS FIRST/LAST options",
2313 errmsg(
"data type %s has no default operator class for access method \"%s\"",
2315 errhint(
"You must specify an operator class for the index or define a default operator class for the data type.")));
2344 errmsg(
"operator class \"%s\" does not exist for access method \"%s\"",
2352 errmsg(
"operator class \"%s\" does not exist for access method \"%s\"",
2366 errmsg(
"operator class \"%s\" does not accept data type %s",
2425 if (!opclass->opcdefault)
2427 if (opclass->opcintype == type_id)
2456 errmsg(
"there are multiple default operator classes for data type %s",
2497 elog(
ERROR,
"cache lookup failed for opclass %u", opclass);
2511 errdetail(
"Could not translate compare type %d for operator family \"%s\" of access method \"%s\".",
2529 errdetail(
"There is no suitable operator in operator family \"%s\" for access method \"%s\".",
2691 if (!isconstraint ||
2714 bool primary,
bool isconstraint)
2735 else if (isconstraint)
2774 foreach(
lc, colnames)
2779 buf[buflen++] =
'_';
2807 foreach(
lc, indexElems)
2816 if (
ielem->indexcolname)
2818 else if (
ielem->name)
2901 if (att->attisdropped)
2904 if (context->
buf->
len > 0)
2915 if (context->
buf->
len > 0)
2917 if (constval->constisnull)
2934 for (
const char *ptr =
extval; *ptr; ptr++)
2937 strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2938 "abcdefghijklmnopqrstuvwxyz"
2939 "0123456789", *ptr) !=
NULL)
2954 if (context->
buf->
len > 0)
2983 char *tablespacename =
NULL;
2986 foreach(
lc,
stmt->params)
2999 errmsg(
"unrecognized %s option \"%s\"",
3006 "REINDEX CONCURRENTLY");
3016 if (tablespacename !=
NULL)
3057 "REINDEX DATABASE");
3061 elog(
ERROR,
"unrecognized object type: %d",
3181 errmsg(
"index \"%s\" was concurrently dropped",
3231 (
errmsg(
"table \"%s\" has no indexes that can be reindexed concurrently",
3245 (
errmsg(
"table \"%s\" has no indexes to reindex",
3292 errmsg(
"cannot reindex system catalogs concurrently")));
3316 errmsg(
"can only reindex the currently open database")));
3330 "ReindexMultipleTables",
3408 errmsg(
"cannot reindex system catalogs concurrently, skipping all")));
3441 errmsg(
"cannot move system relations, skipping all")));
3487 errcontext(
"while reindexing partitioned table \"%s.%s\"",
3490 errcontext(
"while reindexing partitioned index \"%s.%s\"",
3529 "REINDEX TABLE" :
"REINDEX INDEX");
3606 char relpersistence;
3683 (
errmsg(
"table \"%s.%s\" was reindexed",
3758 "ReindexConcurrent",
3803 errmsg(
"cannot reindex system catalogs concurrently")));
3822 errmsg(
"cannot move system relation \"%s\"",
3832 if (!indexRelation->
rd_index->indisvalid)
3835 errmsg(
"skipping reindex of invalid index \"%s.%s\"",
3838 errhint(
"Use DROP INDEX or REINDEX INDEX.")));
3839 else if (indexRelation->
rd_index->indisexclusion)
3842 errmsg(
"cannot reindex exclusion constraint index \"%s.%s\" concurrently, skipping",
3885 if (!indexRelation->
rd_index->indisvalid)
3888 errmsg(
"skipping reindex of invalid index \"%s.%s\"",
3891 errhint(
"Use DROP INDEX or REINDEX INDEX.")));
3933 errmsg(
"cannot reindex system catalogs concurrently")));
3944 errmsg(
"cannot reindex invalid index on TOAST table")));
3968 errmsg(
"cannot move system relation \"%s\"",
3984 idx->indexId = relationOid;
3998 errmsg(
"cannot reindex this type of relation concurrently")));
4016 errmsg(
"cannot move non-shared relation to tablespace \"%s\"",
4055 int save_sec_context;
4080#ifdef USE_INJECTION_POINTS
4092 elog(
ERROR,
"cannot reindex a temporary table concurrently");
4526 object.objectId =
idx->indexId;
4527 object.objectSubId = 0;
4561 (
errmsg(
"index \"%s.%s\" was reindexed",
4573 (
errmsg(
"index \"%s.%s\" was reindexed",
4580 (
errmsg(
"table \"%s.%s\" was reindexed",
4668 elog(
ERROR,
"bogus pg_inherit row: inhrelid %u inhparent %u",
Datum idx(PG_FUNCTION_ARGS)
bool has_privs_of_role(Oid member, Oid role)
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
const IndexAmRoutine * GetIndexAmRoutine(Oid amhandler)
StrategyNumber IndexAmTranslateCompareType(CompareType cmptype, Oid amoid, Oid opfamily, bool missing_ok)
bytea *(* amoptions_function)(Datum reloptions, bool validate)
char * get_am_name(Oid amOid)
void free_attrmap(AttrMap *map)
AttrMap * build_attrmap_by_name(TupleDesc indesc, TupleDesc outdesc, bool missing_ok)
#define InvalidAttrNumber
char * get_tablespace_name(Oid spc_oid)
Oid get_tablespace_oid(const char *tablespacename, bool missing_ok)
Oid GetDefaultTablespace(char relpersistence, bool partitioned)
void pgstat_progress_start_command(ProgressCommandType cmdtype, Oid relid)
void pgstat_progress_incr_param(int index, int64 incr)
void pgstat_progress_update_param(int index, int64 val)
void pgstat_progress_update_multi_param(int nparam, const int *index, const int64 *val)
void pgstat_progress_end_command(void)
@ PROGRESS_COMMAND_CREATE_INDEX
int bms_next_member(const Bitmapset *a, int prevbit)
bool bms_is_member(int x, const Bitmapset *a)
#define IS_HIGHBIT_SET(ch)
#define Assert(condition)
#define OidIsValid(objectId)
bool IsToastNamespace(Oid namespaceId)
bool IsSystemRelation(Relation relation)
bool IsCatalogRelationOid(Oid relid)
bool IsSystemClass(Oid relid, Form_pg_class reltuple)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
bool contain_mutable_functions_after_planning(Expr *expr)
char * defGetString(DefElem *def)
bool defGetBoolean(DefElem *def)
void performMultipleDeletions(const ObjectAddresses *objects, DropBehavior behavior, int flags)
void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs)
ObjectAddresses * new_object_addresses(void)
@ DEPENDENCY_PARTITION_PRI
@ DEPENDENCY_PARTITION_SEC
#define PERFORM_DELETION_CONCURRENT_LOCK
#define PERFORM_DELETION_INTERNAL
ErrorContextCallback * error_context_stack
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
void EventTriggerCollectSimpleCommand(ObjectAddress address, ObjectAddress secondaryObject, const Node *parsetree)
#define palloc_object(type)
#define palloc_array(type, count)
Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
char * OidOutputFunctionCall(Oid functionId, Datum val)
void systable_endscan(SysScanDesc sysscan)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
bool allowSystemTableMods
int NewGUCNestLevel(void)
void RestrictSearchPath(void)
void AtEOXact_GUC(bool isCommit, int nestLevel)
int set_config_option(const char *name, const char *value, GucContext context, GucSource source, GucAction action, bool changeVal, int elevel, bool is_reload)
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
HeapTuple heap_copytuple(HeapTuple tuple)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
void heap_freetuple(HeapTuple htup)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
Oid index_create(Relation heapRelation, const char *indexRelationName, Oid indexRelationId, Oid parentIndexRelid, Oid parentConstraintId, RelFileNumber relFileNumber, IndexInfo *indexInfo, const List *indexColNames, Oid accessMethodId, Oid tableSpaceId, const Oid *collationIds, const Oid *opclassIds, const Datum *opclassOptions, const int16 *coloptions, const NullableDatum *stattargets, Datum reloptions, uint16 flags, uint16 constr_flags, bool allow_system_table_mods, bool is_internal, Oid *constraintId)
void validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
Oid IndexGetRelation(Oid indexId, bool missing_ok)
void index_concurrently_set_dead(Oid heapId, Oid indexId)
void index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
void index_set_state_flags(Oid indexId, IndexStateFlagsAction action)
bool CompareIndexInfo(const IndexInfo *info1, const IndexInfo *info2, const Oid *collations1, const Oid *collations2, const Oid *opfamilies1, const Oid *opfamilies2, const AttrMap *attmap)
bool reindex_relation(const ReindexStmt *stmt, Oid relid, int flags, const ReindexParams *params)
IndexInfo * BuildIndexInfo(Relation index)
void index_check_primary_key(Relation heapRel, const IndexInfo *indexInfo, bool is_alter_table, const IndexStmt *stmt)
void index_concurrently_build(Oid heapRelationId, Oid indexRelationId)
Oid index_create_copy(Relation heapRelation, uint16 flags, Oid oldIndexId, Oid tablespaceOid, const char *newName)
void reindex_index(const ReindexStmt *stmt, Oid indexId, bool skip_constraint_checks, char persistence, const ReindexParams *params)
#define INDEX_CREATE_SUPPRESS_PROGRESS
#define INDEX_CREATE_IS_PRIMARY
#define INDEX_CREATE_IF_NOT_EXISTS
#define REINDEX_REL_PROCESS_TOAST
#define INDEX_CREATE_PARTITIONED
#define REINDEXOPT_CONCURRENTLY
#define REINDEXOPT_MISSING_OK
#define INDEX_CREATE_INVALID
#define INDEX_CONSTR_CREATE_WITHOUT_OVERLAPS
#define INDEX_CREATE_ADD_CONSTRAINT
#define INDEX_CREATE_SKIP_BUILD
#define INDEX_CONSTR_CREATE_DEFERRABLE
#define REINDEXOPT_REPORT_PROGRESS
#define INDEX_CONSTR_CREATE_INIT_DEFERRED
#define INDEX_CREATE_CONCURRENT
#define REINDEXOPT_VERBOSE
#define REINDEX_REL_CHECK_CONSTRAINTS
void index_close(Relation relation, LOCKMODE lockmode)
Relation index_open(Oid relationId, LOCKMODE lockmode)
static bool ReindexRelationConcurrently(const ReindexStmt *stmt, Oid relationOid, const ReindexParams *params)
void ExecReindex(ParseState *pstate, const ReindexStmt *stmt, bool isTopLevel)
static void set_indexsafe_procflags(void)
char * ChooseRelationName(const char *name1, const char *name2, const char *label, Oid namespaceid, bool isconstraint)
static void reindex_error_callback(void *arg)
static List * ChooseIndexColumnNames(Relation rel, const List *indexElems)
static void ReindexIndex(const ReindexStmt *stmt, const ReindexParams *params, bool isTopLevel)
void IndexSetParentIndex(Relation partitionIdx, Oid parentOid)
char * makeObjectName(const char *name1, const char *name2, const char *label)
Oid GetDefaultOpClass(Oid type_id, Oid am_id)
static char * ChooseIndexNameAddition(const List *colnames)
static void ReindexMultipleTables(const ReindexStmt *stmt, const ReindexParams *params)
static bool CompareOpclassOptions(const Datum *opts1, const Datum *opts2, int natts)
static void update_relispartition(Oid relationId, bool newval)
bool CheckIndexCompatible(Oid oldId, const char *accessMethodName, const List *attributeList, const List *exclusionOpNames, bool isWithoutOverlaps)
void WaitForOlderSnapshots(TransactionId limitXmin, bool progress)
static bool ChooseIndexExpressionName_walker(Node *node, CIEN_context *context)
Oid ResolveOpClass(const List *opclass, Oid attrType, const char *accessMethodName, Oid accessMethodId)
static void ReindexPartitions(const ReindexStmt *stmt, Oid relid, const ReindexParams *params, bool isTopLevel)
ObjectAddress DefineIndex(ParseState *pstate, Oid tableId, const IndexStmt *stmt, Oid indexRelationId, Oid parentIndexId, Oid parentConstraintId, int total_parts, bool is_alter_table, bool check_rights, bool check_not_in_use, bool skip_build, bool quiet)
static Oid ReindexTable(const ReindexStmt *stmt, const ReindexParams *params, bool isTopLevel)
static void CheckPredicate(Expr *predicate)
static void ReindexMultipleInternal(const ReindexStmt *stmt, const List *relids, const ReindexParams *params)
static void RangeVarCallbackForReindexIndex(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)
static char * ChooseIndexExpressionName(Relation rel, Node *indexExpr)
void GetOperatorFromCompareType(Oid opclass, Oid rhstype, CompareType cmptype, Oid *opid, StrategyNumber *strat)
static char * ChooseIndexName(const char *tabname, Oid namespaceId, const List *colnames, const List *exclusionOpNames, bool primary, bool isconstraint)
static void ComputeIndexAttrs(ParseState *pstate, IndexInfo *indexInfo, Oid *typeOids, Oid *collationOids, Oid *opclassOids, Datum *opclassOptions, int16 *colOptions, const List *attList, const List *exclusionOpNames, Oid relId, const char *accessMethodName, Oid accessMethodId, bool amcanorder, bool isconstraint, bool iswithoutoverlaps, Oid ddl_userid, int ddl_sec_context, int *ddl_save_nestlevel)
void CatalogTupleUpdate(Relation heapRel, const ItemPointerData *otid, HeapTuple tup)
void CatalogTupleDelete(Relation heapRel, const ItemPointerData *tid)
#define INJECTION_POINT(name, arg)
void CacheInvalidateRelcacheByRelid(Oid relid)
List * lcons_oid(Oid datum, List *list)
List * lappend(List *list, void *datum)
List * list_concat_copy(const List *list1, const List *list2)
List * lappend_oid(List *list, Oid datum)
void list_free(List *list)
void UnlockTuple(Relation relation, const ItemPointerData *tid, LOCKMODE lockmode)
void UnlockRelationOid(Oid relid, LOCKMODE lockmode)
void WaitForLockersMultiple(List *locktags, LOCKMODE lockmode, bool progress)
void LockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode)
void LockRelationOid(Oid relid, LOCKMODE lockmode)
void WaitForLockers(LOCKTAG heaplocktag, LOCKMODE lockmode, bool progress)
void UnlockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode)
bool VirtualXactLock(VirtualTransactionId vxid, bool wait)
#define VirtualTransactionIdIsValid(vxid)
#define VirtualTransactionIdEquals(vxid1, vxid2)
#define SetInvalidVirtualTransactionId(vxid)
#define AccessExclusiveLock
#define InplaceUpdateTupleLock
#define ShareUpdateExclusiveLock
#define SET_LOCKTAG_RELATION(locktag, dboid, reloid)
char * get_rel_name(Oid relid)
Oid get_opclass_method(Oid opclass)
char get_rel_persistence(Oid relid)
bool get_index_isvalid(Oid index_oid)
Oid get_opclass_input_type(Oid opclass)
Oid get_opclass_family(Oid opclass)
Oid get_opfamily_member_for_cmptype(Oid opfamily, Oid lefttype, Oid righttype, CompareType cmptype)
bool get_opclass_opfamily_and_input_type(Oid opclass, Oid *opfamily, Oid *opcintype)
char * get_database_name(Oid dbid)
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
char * get_opname(Oid opno)
Datum get_attoptions(Oid relid, int16 attnum)
char get_rel_relkind(Oid relid)
Oid get_rel_namespace(Oid relid)
RegProcedure get_opcode(Oid opno)
int get_op_opfamily_strategy(Oid opno, Oid opfamily)
Oid get_opfamily_member(Oid opfamily, Oid lefttype, Oid righttype, int16 strategy)
char * get_opfamily_name(Oid opfid, bool missing_ok)
char * get_func_name(Oid funcid)
bool type_is_collatable(Oid typid)
Oid get_opfamily_method(Oid opfid)
Oid getBaseType(Oid typid)
char * get_namespace_name(Oid nspid)
Oid get_commutator(Oid opno)
void op_input_types(Oid opno, Oid *lefttype, Oid *righttype)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
IndexInfo * makeIndexInfo(int numattrs, int numkeyattrs, Oid amoid, List *expressions, List *predicates, bool unique, bool nulls_not_distinct, bool isready, bool concurrent, bool summarizing, bool withoutoverlaps)
List * make_ands_implicit(Expr *clause)
int pg_mbcliplen(const char *mbstr, int len, int limit)
char * pstrdup(const char *in)
void pfree(void *pointer)
void MemoryContextDelete(MemoryContext context)
MemoryContext PortalContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define ALLOCSET_SMALL_SIZES
#define IsBootstrapProcessingMode()
#define SECURITY_RESTRICTED_OPERATION
#define CHECK_FOR_INTERRUPTS()
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
void SetUserIdAndSecContext(Oid userid, int sec_context)
Oid OpclassnameGetOpcid(Oid amid, const char *opcname)
char * NameListToString(const List *names)
Oid LookupExplicitNamespace(const char *nspname, bool missing_ok)
bool isTempNamespace(Oid namespaceId)
Oid get_collation_oid(List *collname, bool missing_ok)
void DeconstructQualifiedName(const List *names, char **nspname_p, char **objname_p)
Oid get_namespace_oid(const char *nspname, bool missing_ok)
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
Oid exprType(const Node *expr)
Oid exprCollation(const Node *expr)
#define expression_tree_walker(n, w, c)
#define IsA(nodeptr, _type_)
const ObjectAddress InvalidObjectAddress
#define ObjectAddressSet(addr, class_id, object_id)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
TYPCATEGORY TypeCategory(Oid type)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
bool IsPreferredType(TYPCATEGORY category, Oid type)
int parser_errposition(ParseState *pstate, int location)
Oid compatible_oper_opid(List *op, Oid arg1, Oid arg2, bool noError)
IndexStmt * generateClonedIndexStmt(RangeVar *heapRel, Relation source_idx, const AttrMap *attmap, Oid *constraintOid)
@ PARTITION_STRATEGY_HASH
@ REINDEX_OBJECT_DATABASE
PartitionKey RelationGetPartitionKey(Relation rel)
PartitionDesc RelationGetPartitionDesc(Relation rel, bool omit_detached)
END_CATALOG_STRUCT typedef FormData_pg_am * Form_pg_am
FormData_pg_attribute * Form_pg_attribute
static void fix_dependencies(ArchiveHandle *AH)
int errdetail_relkind_not_supported(char relkind)
FormData_pg_class * Form_pg_class
Oid get_relation_idx_constraint_oid(Oid relationId, Oid indexId)
void ConstraintSetParentConstraint(Oid childConstrId, Oid parentConstrId, Oid childTableId)
bool ConstraintNameExists(const char *conname, Oid namespaceid)
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
long deleteDependencyRecordsForClass(Oid classId, Oid objectId, Oid refclassId, char deptype)
END_CATALOG_STRUCT typedef FormData_pg_index * Form_pg_index
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
void StoreSingleInheritance(Oid relationId, Oid parentOid, int32 seqNumber)
bool has_superclass(Oid relationId)
END_CATALOG_STRUCT typedef FormData_pg_inherits * Form_pg_inherits
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
#define list_make1_oid(x1)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
END_CATALOG_STRUCT typedef FormData_pg_opclass * Form_pg_opclass
const char * pg_rusage_show(const PGRUsage *ru0)
void pg_rusage_init(PGRUsage *ru0)
static char buf[DEFAULT_XLOG_SEG_SIZE]
size_t strlcpy(char *dst, const char *src, size_t siz)
static bool DatumGetBool(Datum X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
#define PointerGetDatum(X)
#define PROC_IS_AUTOVACUUM
VirtualTransactionId * GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0, bool allDbs, int excludeVacuum, int *nvxids)
PGPROC * ProcNumberGetProc(ProcNumber procNumber)
#define PROGRESS_CREATEIDX_PHASE_WAIT_4
#define PROGRESS_CREATEIDX_PHASE_BUILD
#define PROGRESS_CREATEIDX_PARTITIONS_DONE
#define PROGRESS_CREATEIDX_PHASE_WAIT_1
#define PROGRESS_CREATEIDX_COMMAND_CREATE_CONCURRENTLY
#define PROGRESS_CREATEIDX_ACCESS_METHOD_OID
#define PROGRESS_WAITFOR_DONE
#define PROGRESS_CREATEIDX_PHASE_WAIT_3
#define PROGRESS_WAITFOR_TOTAL
#define PROGRESS_CREATEIDX_COMMAND_REINDEX_CONCURRENTLY
#define PROGRESS_CREATEIDX_COMMAND_CREATE
#define PROGRESS_WAITFOR_CURRENT_PID
#define PROGRESS_CREATEIDX_PHASE_WAIT_2
#define PROGRESS_CREATEIDX_PHASE
#define PROGRESS_CREATEIDX_PHASE_VALIDATE_IDXSCAN
#define PROGRESS_CREATEIDX_PHASE_WAIT_5
#define PROGRESS_CREATEIDX_INDEX_OID
#define PROGRESS_CREATEIDX_PARTITIONS_TOTAL
#define PROGRESS_CREATEIDX_COMMAND
char * format_operator(Oid operator_oid)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
#define RELATION_IS_OTHER_TEMP(relation)
#define RelationGetNamespace(relation)
List * RelationGetIndexList(Relation relation)
List * RelationGetIndexPredicate(Relation relation)
List * RelationGetIndexExpressions(Relation relation)
void RelationGetExclusionInfo(Relation indexRelation, Oid **operators, Oid **procs, uint16 **strategies)
bytea * index_reloptions(amoptions_function amoptions, Datum reloptions, bool validate)
Datum transformRelOptions(Datum oldOptions, List *defList, const char *nameSpace, const char *const validnsps[], bool acceptOidsOff, bool isReset)
#define RelFileNumberIsValid(relnumber)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Snapshot GetTransactionSnapshot(void)
void UnregisterSnapshot(Snapshot snapshot)
void PushActiveSnapshot(Snapshot snapshot)
bool ActiveSnapshotSet(void)
Snapshot RegisterSnapshot(Snapshot snapshot)
void PopActiveSnapshot(void)
#define InitDirtySnapshot(snapshotdata)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
#define HTEqualStrategyNumber
#define BTEqualStrategyNumber
#define ERRCODE_DUPLICATE_OBJECT
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
struct ErrorContextCallback * previous
void(* callback)(void *arg)
uint16 * ii_ExclusionStrats
AttrNumber ii_IndexAttrNumbers[INDEX_MAX_KEYS]
#define FirstLowInvalidHeapAttributeNumber
HeapTuple SearchSysCacheLockedCopy1(SysCacheIdentifier cacheId, Datum key1)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache3(SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3)
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
Datum SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
#define SearchSysCacheExists1(cacheId, key1)
Relation try_table_open(Oid relationId, LOCKMODE lockmode)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, ScanKeyData *key)
static void table_endscan(TableScanDesc scan)
void CheckTableNotInUse(Relation rel, const char *stmt)
void SetRelationHasSubclass(Oid relationId, bool relhassubclass)
void RangeVarCallbackMaintainsTable(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)
#define InvalidTransactionId
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos)
void CommandCounterIncrement(void)
void PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
void StartTransactionCommand(void)
void CommitTransactionCommand(void)