diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a38b3f..005c6d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ WIP version 2.0.0: **Miscellaneous** - Use a dedicated MemoryContext to store hypothetical objects + - Fix compatibility on Windows (Godwottery) **Bug fixes:** diff --git a/hypopg.c b/hypopg.c index e136431..ce0b869 100644 --- a/hypopg.c +++ b/hypopg.c @@ -43,27 +43,27 @@ PG_MODULE_MAGIC; typedef struct hypoWalkerContext { - bool explain_found; + bool explain_found; } hypoWalkerContext; /*--- Variables exported ---*/ -bool isExplain; -bool hypo_is_enabled; +bool isExplain; +bool hypo_is_enabled; MemoryContext HypoMemoryContext; /*--- Variables not exported ---*/ -static List *pending_invals = NIL; /* List of interesting OID for which we - received inval messages that need to be - processed. */ +static List *pending_invals = NIL; /* List of interesting OID for which we + * received inval messages that need to be + * processed. */ /*--- Functions --- */ -PGDLLEXPORT void _PG_init(void); -PGDLLEXPORT void _PG_fini(void); +PGDLLEXPORT void _PG_init(void); +PGDLLEXPORT void _PG_fini(void); -PGDLLEXPORT Datum hypopg_reset(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_reset(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(hypopg_reset); @@ -100,15 +100,15 @@ static void hypo_get_relation_info_hook(PlannerInfo *root, static get_relation_info_hook_type prev_get_relation_info_hook = NULL; static bool hypo_get_relation_stats_hook(PlannerInfo *root, - RangeTblEntry *rte, - AttrNumber attnum, - VariableStatData *vardata); + RangeTblEntry *rte, + AttrNumber attnum, + VariableStatData *vardata); static get_relation_stats_hook_type prev_get_relation_stats_hook = NULL; #if PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 110000 static void hypo_set_rel_pathlist_hook(PlannerInfo *root, - RelOptInfo *rel, - Index rti, - RangeTblEntry *rte); + RelOptInfo *rel, + Index rti, + RangeTblEntry *rte); static set_rel_pathlist_hook_type prev_set_rel_pathlist_hook = NULL; #endif @@ -144,15 +144,15 @@ _PG_init(void) #endif HypoMemoryContext = AllocSetContextCreate(TopMemoryContext, - "HypoPG context", + "HypoPG context", #if PG_VERSION_NUM >= 90600 - ALLOCSET_DEFAULT_SIZES + ALLOCSET_DEFAULT_SIZES #else - ALLOCSET_DEFAULT_MINSIZE, - ALLOCSET_DEFAULT_INITSIZE, - ALLOCSET_DEFAULT_MAXSIZE + ALLOCSET_DEFAULT_MINSIZE, + ALLOCSET_DEFAULT_INITSIZE, + ALLOCSET_DEFAULT_MAXSIZE #endif - ); + ); DefineCustomBoolVariable("hypopg.enabled", "Enable / Disable hypopg", @@ -240,15 +240,15 @@ hypo_utility_hook( DestReceiver *dest, char *completionTag) { - hypoWalkerContext hypo_context = { 0 }; + hypoWalkerContext hypo_context = {0}; hypo_query_walker( #if PG_VERSION_NUM >= 100000 - (Node *) pstmt, + (Node *) pstmt, #else - parsetree, + parsetree, #endif - &hypo_context); + &hypo_context); isExplain = hypo_context.explain_found; @@ -291,7 +291,7 @@ hypo_utility_hook( #endif params, #if PG_VERSION_NUM >= 100000 - queryEnv, + queryEnv, #endif #if PG_VERSION_NUM < 90300 isTopLevel, @@ -313,9 +313,10 @@ hypo_query_walker(Node *node, hypoWalkerContext *context) { case T_PlannedStmt: { - Node *stmt = ((PlannedStmt *) node)->utilityStmt; + Node *stmt = ((PlannedStmt *) node)->utilityStmt; + return query_or_expression_tree_walker(stmt, hypo_query_walker, - context, QTW_IGNORE_RANGE_TABLE); + context, QTW_IGNORE_RANGE_TABLE); } case T_ExplainStmt: { @@ -332,6 +333,7 @@ hypo_query_walker(Node *node, hypoWalkerContext *context) context->explain_found = true; #if PG_VERSION_NUM >= 100000 + /* * No point in looking for unhandled command type if there are * no hypothetical partitions @@ -348,35 +350,36 @@ hypo_query_walker(Node *node, hypoWalkerContext *context) #if PG_VERSION_NUM >= 100000 case T_Query: { - Query *query = (Query *) node; + Query *query = (Query *) node; Assert(context->explain_found); if (context->explain_found && - (query->commandType == CMD_UPDATE || - query->commandType == CMD_DELETE) - ) + (query->commandType == CMD_UPDATE || + query->commandType == CMD_DELETE) + ) { RangeTblEntry *rte = rt_fetch(query->resultRelation, - query->rtable); + query->rtable); if (hypo_table_oid_is_hypothetical(rte->relid)) elog(ERROR, "hypopg: UPDATE and DELETE on hypothetically" - " partitioned tables are not supported"); + " partitioned tables are not supported"); } if (query->cteList) { - ListCell *lc; + ListCell *lc; foreach(lc, query->cteList) { CommonTableExpr *cte = (CommonTableExpr *) lfirst(lc); + hypo_query_walker(cte->ctequery, context); } } return query_or_expression_tree_walker(node, hypo_query_walker, - context, QTW_IGNORE_RANGE_TABLE); + context, QTW_IGNORE_RANGE_TABLE); } break; #endif @@ -385,7 +388,7 @@ hypo_query_walker(Node *node, hypoWalkerContext *context) } return query_or_expression_tree_walker(node, hypo_query_walker, context, - QTW_IGNORE_RANGE_TABLE); + QTW_IGNORE_RANGE_TABLE); } /* @@ -403,7 +406,7 @@ static void hypo_CacheRelCallback(Datum arg, Oid relid) { #if PG_VERSION_NUM >= 100000 - hypoTable *entry; + hypoTable *entry; entry = hypo_find_table(relid, true); if (entry) @@ -428,7 +431,7 @@ void hypo_process_inval(void) { #if PG_VERSION_NUM >= 100000 - ListCell *lc; + ListCell *lc; Assert(IsTransactionState()); @@ -446,13 +449,13 @@ hypo_process_inval(void) { Oid relid = lfirst_oid(lc); hypoTable *entry = hypo_find_table(relid, false); - char *relname = get_rel_name(relid); - bool found = false; + char *relname = get_rel_name(relid); + bool found = false; /* * The pending invalidations should be filtered and recorded after - * removing an entry, and should always be processed before any attempt - * to remove a hypothetical object, so we shoudl always find a + * removing an entry, and should always be processed before any + * attempt to remove a hypothetical object, so we shoudl always find a * hypoTable at this point. */ Assert(entry); @@ -462,7 +465,7 @@ hypo_process_inval(void) if (found) elog(DEBUG1, "hypopg: hypo_process_inval removed table %s (%d)", - relname, relid); + relname, relid); } list_free(pending_invals); @@ -502,14 +505,14 @@ hypo_executorEnd_hook(QueryDesc *queryDesc) */ static void hypo_get_relation_info_hook(PlannerInfo *root, - Oid relationObjectId, - bool inhparent, - RelOptInfo *rel) + Oid relationObjectId, + bool inhparent, + RelOptInfo *rel) { Relation relation; #if PG_VERSION_NUM >= 100000 RangeTblEntry *rte = planner_rt_fetch(rel->relid, root); - bool hypopart = false; + bool hypopart = false; #endif if (HYPO_ENABLED()) @@ -517,9 +520,10 @@ hypo_get_relation_info_hook(PlannerInfo *root, #if PG_VERSION_NUM >= 100000 hypopart = hypo_table_oid_is_hypothetical(relationObjectId); + /* - * If this relation is table we want to partition hypothetical, - * inject hypothetical partitioning + * If this relation is table we want to partition hypothetical, inject + * hypothetical partitioning */ if (hypopart) hypo_injectHypotheticalPartitioning(root, relationObjectId, rel); @@ -534,10 +538,11 @@ hypo_get_relation_info_hook(PlannerInfo *root, #endif ) { - ListCell *lc; - Oid parentId = relationObjectId; + ListCell *lc; + Oid parentId = relationObjectId; #if PG_VERSION_NUM >= 100000 + /* * If this rel is a partition, get root table oid to look for * hypothetical indexes. @@ -548,19 +553,20 @@ hypo_get_relation_info_hook(PlannerInfo *root, { /* * when this is a real partition, we have to search root - * table from PlannerInfo to get root table oid. when this - * is a hypothetical partition, root table oid is equal to - * relationObjectId, so nothing to do + * table from PlannerInfo to get root table oid. when + * this is a hypothetical partition, root table oid is + * equal to relationObjectId, so nothing to do */ AppendRelInfo *appinfo; RelOptInfo *parentrel = rel; + do { #if PG_VERSION_NUM >= 110000 appinfo = root->append_rel_array[parentrel->relid]; #else appinfo = find_childrel_appendrelinfo(root, parentrel); -#endif /* pg10 only */ +#endif /* pg10 only */ parentrel = find_base_rel(root, appinfo->parent_relid); } while (parentrel->reloptkind == RELOPT_OTHER_MEMBER_REL); parentId = appinfo->parent_reloid; @@ -580,7 +586,7 @@ hypo_get_relation_info_hook(PlannerInfo *root, #if PG_VERSION_NUM >= 110000 && !rel->part_scheme #endif - ) + ) { oid = parentId; } @@ -590,17 +596,19 @@ hypo_get_relation_info_hook(PlannerInfo *root, { oid = relationObjectId; } + /* * check for hypothetical index on hypothetical leaf partition */ else if (hypo_table_oid_is_hypothetical(relationObjectId) && - HYPO_TABLE_RTE_HAS_HYPOOID(rte) && - entry->relid == HYPO_TABLE_RTE_GET_HYPOOID(rte) - ) + HYPO_TABLE_RTE_HAS_HYPOOID(rte) && + entry->relid == HYPO_TABLE_RTE_GET_HYPOOID(rte) + ) { oid = HYPO_TABLE_RTE_GET_HYPOOID(rte); } #endif + /* * hypothetical index found, add it to the relation's * indextlist @@ -619,17 +627,17 @@ hypo_get_relation_info_hook(PlannerInfo *root, static bool hypo_get_relation_stats_hook(PlannerInfo *root, - RangeTblEntry *rte, - AttrNumber attnum, - VariableStatData *vardata) + RangeTblEntry *rte, + AttrNumber attnum, + VariableStatData *vardata) { #if PG_VERSION_NUM < 100000 return false; #else - Oid poid = InvalidOid; + Oid poid = InvalidOid; hypoStatsKey key; hypoStatsEntry *entry; - bool found; + bool found; /* Nothing to do if it's not a plain relation */ if (rte->rtekind != RTE_RELATION) @@ -638,8 +646,8 @@ hypo_get_relation_stats_hook(PlannerInfo *root, /* * If this is a root table hypothetically partitioned, we have to retrieve * the pg_statistic row ourselves, even if no hypopg_analyze has been - * performed yet, because postgres will search for an entry with stainherit - * = true, which won't exist. + * performed yet, because postgres will search for an entry with + * stainherit = true, which won't exist. */ if (HYPO_RTE_IS_TAGGED(rte) && (!HYPO_TABLE_RTE_HAS_HYPOOID(rte))) { @@ -708,8 +716,8 @@ hypo_set_rel_pathlist_hook(PlannerInfo *root, Index rti, RangeTblEntry *rte) { - if(HYPO_ENABLED() && hypo_table_oid_is_hypothetical(rte->relid) && rte->relkind == 'r') - hypo_markDummyIfExcluded(root,rel,rti,rte); + if (HYPO_ENABLED() && hypo_table_oid_is_hypothetical(rte->relid) && rte->relkind == 'r') + hypo_markDummyIfExcluded(root, rel, rti, rte); if (prev_set_rel_pathlist_hook) prev_set_rel_pathlist_hook(root, rel, rti, rte); diff --git a/hypopg_index.c b/hypopg_index.c index acd159d..3ad8187 100644 --- a/hypopg_index.c +++ b/hypopg_index.c @@ -75,7 +75,7 @@ #if PG_VERSION_NUM >= 90600 /* this will be updated, when needed, by hypo_discover_am */ -static Oid BLOOM_AM_OID = InvalidOid; +static Oid BLOOM_AM_OID = InvalidOid; #endif /*--- Variables exported ---*/ @@ -99,10 +99,10 @@ static void hypo_discover_am(char *amname, Oid oid); static void hypo_estimate_index_simple(hypoIndex *entry, BlockNumber *pages, double *tuples); static void hypo_estimate_index(hypoIndex *entry, RelOptInfo *rel, - PlannerInfo *root); -static int hypo_estimate_index_colsize(hypoIndex *entry, int col); + PlannerInfo *root); +static int hypo_estimate_index_colsize(hypoIndex *entry, int col); static void hypo_index_check_uniqueness_compatibility(IndexStmt *stmt, - Oid relid, hypoIndex *entry); + Oid relid, hypoIndex *entry); static void hypo_index_pfree(hypoIndex *entry); static bool hypo_index_remove(Oid indexid); static const hypoIndex *hypo_index_store_parsetree(IndexStmt *node, @@ -120,7 +120,7 @@ static void hypo_set_indexname(hypoIndex *entry, char *indexname); */ static hypoIndex * hypo_newIndex(Oid relid, char *accessMethod, int nkeycolumns, int ninccolumns, - List *options) + List *options) { /* must be declared "volatile", because used in a PG_CATCH() */ hypoIndex *volatile entry; @@ -153,6 +153,7 @@ hypo_newIndex(Oid relid, char *accessMethod, int nkeycolumns, int ninccolumns, entry->relam = HeapTupleGetOid(tuple); #if PG_VERSION_NUM >= 90600 + /* * Since 9.6, AM informations are available through an amhandler function, * returning an IndexAmRoutine containing what's needed. @@ -250,15 +251,15 @@ hypo_newIndex(Oid relid, char *accessMethod, int nkeycolumns, int ninccolumns, #if PG_VERSION_NUM >= 90600 && entry->relam != BLOOM_AM_OID #endif - ) + ) { - /* - * do not store hypothetical indexes with access method not - * supported - */ - elog(ERROR, "hypopg: access method \"%s\" is not supported", - accessMethod); - break; + /* + * do not store hypothetical indexes with access method not + * supported + */ + elog(ERROR, "hypopg: access method \"%s\" is not supported", + accessMethod); + break; } /* No more elog beyond this point. */ @@ -350,15 +351,15 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) if (!table) elog(ERROR, "hypopg: table %s does not exists", - quote_identifier(rv->relname)); + quote_identifier(rv->relname)); if (table->partkey) #if PG_VERSION_NUM < 110000 elog(ERROR, "hypopg: cannot add hypothetical index on non-leaf " - "hypothetical partition"); + "hypothetical partition"); #else elog(ERROR, "hypopg: cannot add hypothetical index on non-leaf " - "or non-root hypothetical partition"); + "or non-root hypothetical partition"); #endif relid = table->rootid; @@ -382,7 +383,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) table = hypo_find_table(relid, true); if (table) elog(ERROR, "hypopg: cannot add hypothetical index on non-leaf " - "hypothetical partition"); + "hypothetical partition"); #endif #if PG_VERSION_NUM >= 110000 @@ -392,11 +393,11 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) if (!ok) elog(ERROR, "hypopg: cannot add hypothetical index on non-leaf " - "or non-root partition"); + "or non-root partition"); #endif if (!ok) elog(ERROR, "hypopg: cannot add hypothetical index on non-leaf " - "partition"); + "partition"); } #endif @@ -450,13 +451,13 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) if (node->unique && !entry->amcanunique) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("hypopg: access method \"%s\" does not support unique indexes", - node->accessMethod))); + errmsg("hypopg: access method \"%s\" does not support unique indexes", + node->accessMethod))); if (nkeycolumns > 1 && !entry->amcanmulticol) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("hypopg: access method \"%s\" does not support multicolumn indexes", - node->accessMethod))); + errmsg("hypopg: access method \"%s\" does not support multicolumn indexes", + node->accessMethod))); entry->unique = node->unique; entry->ncolumns = nkeycolumns + ninccolumns; @@ -532,8 +533,8 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) * they're only computed when a real index exists (selectivity * and average width). */ - MemoryContext oldcontext; - Node *expr = attribute->expr; + MemoryContext oldcontext; + Node *expr = attribute->expr; Assert(expr != NULL); entry->indexcollations[attn] = exprCollation(attribute->expr); @@ -556,7 +557,9 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) * Treat it like simple attribute anyway. */ entry->indexkeys[attn] = ((Var *) expr)->varattno; - /* Generated index name will have _expr instead of attname + + /* + * Generated index name will have _expr instead of attname * in generated index name, and error message will also be * slighty different in case on unexisting column from a * simple attribute, but that's how ComputeIndexAttrs() @@ -588,7 +591,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) oldcontext = MemoryContextSwitchTo(HypoMemoryContext); entry->indexprs = lappend(entry->indexprs, - (Node *) copyObject(attribute->expr)); + (Node *) copyObject(attribute->expr)); MemoryContextSwitchTo(oldcontext); } } @@ -651,7 +654,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) entry->nulls_first[attn] = true; } else if (attribute->nulls_ordering == SORTBY_NULLS_FIRST) - entry->nulls_first[attn] = true; + entry->nulls_first[attn] = true; } /* handle index-only scan info */ @@ -673,7 +676,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) #else /* per-column IOS information */ entry->canreturn[attn] = hypo_can_return(entry, atttype, attn, - node->accessMethod); + node->accessMethod); #endif attn++; @@ -692,15 +695,16 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) if (attno < 0 && attno != ObjectIdAttributeNumber) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("hypopg: index creation on system columns is not supported"))); + errmsg("hypopg: index creation on system columns is not supported"))); } #if PG_VERSION_NUM >= 110000 - /* - * check for uniqueness compatibility with (hypothetically) partitioned - * tables - */ - hypo_index_check_uniqueness_compatibility(node, relid, entry); + + /* + * check for uniqueness compatibility with (hypothetically) + * partitioned tables + */ + hypo_index_check_uniqueness_compatibility(node, relid, entry); #endif @@ -767,19 +771,20 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) /* per-column IOS information */ entry->canreturn[attn] = hypo_can_return(entry, atttype, attn, - node->accessMethod); + node->accessMethod); attn++; } Assert(attn == (nkeycolumns + ninccolumns)); #endif + /* * Also check for system columns used in expressions or predicates. */ if (entry->indexprs || entry->indpred) { Bitmapset *indexattrs = NULL; - int i; + int i; pull_varattnos((Node *) entry->indexprs, 1, &indexattrs); pull_varattnos((Node *) entry->indpred, 1, &indexattrs); @@ -791,7 +796,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) indexattrs)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("hypopg: index creation on system columns is not supported"))); + errmsg("hypopg: index creation on system columns is not supported"))); } } @@ -805,9 +810,9 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) "exceeds maximum %ld", ind_avg_width, HYPO_BTMaxItemSize), errhint("Values larger than 1/3 of a buffer page " - "cannot be indexed.\nConsider a function index " - " of an MD5 hash of the value, or use full text " - "indexing\n(which is not yet supported by hypopg)." + "cannot be indexed.\nConsider a function index " + " of an MD5 hash of the value, or use full text " + "indexing\n(which is not yet supported by hypopg)." ))); /* Warn about posssible error with a 80% avg size */ else if (ind_avg_width >= HYPO_BTMaxItemSize * .8) @@ -817,9 +822,9 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) "is close to maximum %ld", ind_avg_width, HYPO_BTMaxItemSize), errhint("Values larger than 1/3 of a buffer page " - "cannot be indexed.\nConsider a function index " - " of an MD5 hash of the value, or use full text " - "indexing\n(which is not yet supported by hypopg)." + "cannot be indexed.\nConsider a function index " + " of an MD5 hash of the value, or use full text " + "indexing\n(which is not yet supported by hypopg)." ))); } @@ -935,12 +940,12 @@ hypo_index_remove(Oid indexid) */ static void hypo_index_check_uniqueness_compatibility(IndexStmt *stmt, Oid relid, - hypoIndex *entry) + hypoIndex *entry) { - PartitionKey key = NULL; - Relation rel; - const char *extra; - int i; + PartitionKey key = NULL; + Relation rel; + const char *extra; + int i; if (!stmt->unique) return; @@ -949,7 +954,7 @@ hypo_index_check_uniqueness_compatibility(IndexStmt *stmt, Oid relid, if (hypo_table_oid_is_hypothetical(relid)) { - hypoTable *table = hypo_find_table(relid, false); + hypoTable *table = hypo_find_table(relid, false); key = table->partkey; extra = "hypothetical "; @@ -967,13 +972,13 @@ hypo_index_check_uniqueness_compatibility(IndexStmt *stmt, Oid relid, } /* - * A partitioned table can have unique indexes, as long as all the - * columns in the partition key appear in the unique key. A - * partition-local index can enforce global uniqueness iff the PK - * value completely determines the partition that a row is in. + * A partitioned table can have unique indexes, as long as all the columns + * in the partition key appear in the unique key. A partition-local index + * can enforce global uniqueness iff the PK value completely determines + * the partition that a row is in. * - * Thus, verify that all the columns in the partition key appear in - * the unique key definition. + * Thus, verify that all the columns in the partition key appear in the + * unique key definition. */ for (i = 0; i < key->partnatts; i++) { @@ -1072,11 +1077,11 @@ hypo_injectHypotheticalIndex(PlannerInfo *root, { IndexOptInfo *index; int ncolumns, - /* - * For convenience and readability, use nkeycolumns even for - * pg10- version. In this case, this var will be initialized - * to ncolumns - */ + + /* + * For convenience and readability, use nkeycolumns even for pg10- + * version. In this case, this var will be initialized to ncolumns + */ nkeycolumns, i; @@ -1191,7 +1196,8 @@ hypo_injectHypotheticalIndex(PlannerInfo *root, index->amcanparallel = entry->amcanparallel; #endif - /* these has already been handled in hypo_index_store_parsetree() if any + /* + * these has already been handled in hypo_index_store_parsetree() if any * * We need deep copies since we will modify index->indexprs and * index->indpred later. So we should copy them from hypoIndex via @@ -1318,7 +1324,7 @@ hypopg(PG_FUNCTION_ARGS) Datum values[HYPO_INDEX_NB_COLS]; bool nulls[HYPO_INDEX_NB_COLS]; ListCell *lc2; - StringInfoData exprsString; + StringInfoData exprsString; int i = 0; memset(values, 0, sizeof(values)); @@ -1339,7 +1345,7 @@ hypopg(PG_FUNCTION_ARGS) initStringInfo(&exprsString); foreach(lc2, entry->indexprs) { - Node *expr = lfirst(lc2); + Node *expr = lfirst(lc2); appendStringInfo(&exprsString, "%s", nodeToString(expr)); } @@ -1506,13 +1512,14 @@ hypopg_relation_size(PG_FUNCTION_ARGS) Datum hypopg_get_indexdef(PG_FUNCTION_ARGS) { - Oid indexid = PG_GETARG_OID(0); - ListCell *indexpr_item; - StringInfoData buf; - hypoIndex *entry = NULL; - ListCell *lc; - List *context; - int keyno, cpt = 0; + Oid indexid = PG_GETARG_OID(0); + ListCell *indexpr_item; + StringInfoData buf; + hypoIndex *entry = NULL; + ListCell *lc; + List *context; + int keyno, + cpt = 0; foreach(lc, hypoIndexes) { @@ -1527,16 +1534,16 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS) initStringInfo(&buf); appendStringInfo(&buf, "CREATE %s ON %s.%s USING %s (", - (entry->unique ? "UNIQUE INDEX" : "INDEX"), - quote_identifier(get_namespace_name(get_rel_namespace(entry->relid))), - quote_identifier(get_rel_name(entry->relid)), - get_am_name(entry->relam)); + (entry->unique ? "UNIQUE INDEX" : "INDEX"), + quote_identifier(get_namespace_name(get_rel_namespace(entry->relid))), + quote_identifier(get_rel_name(entry->relid)), + get_am_name(entry->relam)); indexpr_item = list_head(entry->indexprs); context = deparse_context_for(get_rel_name(entry->relid), entry->relid); - for (keyno=0; keynonkeycolumns; keyno++) + for (keyno = 0; keyno < entry->nkeycolumns; keyno++) { Oid indcoll; Oid keycoltype; @@ -1551,10 +1558,10 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS) int32 keycoltypmod; #if PG_VERSION_NUM >= 110000 appendStringInfo(&buf, "%s", get_attname(entry->relid, - entry->indexkeys[keyno], false)); + entry->indexkeys[keyno], false)); #else appendStringInfo(&buf, "%s", get_attname(entry->relid, - entry->indexkeys[keyno])); + entry->indexkeys[keyno])); #endif get_atttypetypmodcoll(entry->relid, entry->indexkeys[keyno], @@ -1576,7 +1583,7 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS) /* Need parens if it's not a bare function call */ if (indexkey && IsA(indexkey, FuncExpr) && - ((FuncExpr *) indexkey)->funcformat == COERCE_EXPLICIT_CALL) + ((FuncExpr *) indexkey)->funcformat == COERCE_EXPLICIT_CALL) appendStringInfoString(&buf, str); else appendStringInfo(&buf, "(%s)", str); @@ -1623,13 +1630,13 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS) if (entry->ncolumns > entry->nkeycolumns) { appendStringInfo(&buf, " INCLUDE ("); - for (keyno=entry->nkeycolumns; keynoncolumns; keyno++) + for (keyno = entry->nkeycolumns; keyno < entry->ncolumns; keyno++) { if (keyno != entry->nkeycolumns) appendStringInfo(&buf, ", "); appendStringInfo(&buf, "%s", get_attname(entry->relid, - entry->indexkeys[keyno], false)); + entry->indexkeys[keyno], false)); } appendStringInfo(&buf, ")"); } @@ -1641,7 +1648,7 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS) foreach(lc, entry->options) { - DefElem *elem = (DefElem *) lfirst(lc); + DefElem *elem = (DefElem *) lfirst(lc); appendStringInfo(&buf, "%s = ", elem->defname); @@ -1652,8 +1659,8 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS) else if (strcmp(elem->defname, "length") == 0) appendStringInfo(&buf, "%d", (int32) intVal(elem->arg)); else - elog(WARNING," hypopg: option %s unhandled, please report the bug", - elem->defname); + elog(WARNING, " hypopg: option %s unhandled, please report the bug", + elem->defname); } appendStringInfo(&buf, ")"); } @@ -1661,7 +1668,7 @@ hypopg_get_indexdef(PG_FUNCTION_ARGS) if (entry->indpred) { appendStringInfo(&buf, " WHERE %s", deparse_expression((Node *) - make_ands_explicit(entry->indpred), context, false, false)); + make_ands_explicit(entry->indpred), context, false, false)); } PG_RETURN_TEXT_P(cstring_to_text(buf.data)); @@ -1797,7 +1804,7 @@ hypo_estimate_index(hypoIndex *entry, RelOptInfo *rel, PlannerInfo *root) entry->relid, InvalidOid); elog(DEBUG1, "hypopg: selectivity for index \"%s\": %lf", - entry->indexname, selectivity); + entry->indexname, selectivity); entry->tuples = selectivity * rel->tuples; } @@ -1843,7 +1850,7 @@ hypo_estimate_index(hypoIndex *entry, RelOptInfo *rel, PlannerInfo *root) usable_page_size = BLCKSZ - SizeOfPageHeaderData - sizeof(BTPageOpaqueData); bloat_factor = (200.0 - - (fillfactor == 0 ? BTREE_DEFAULT_FILLFACTOR : fillfactor) + - (fillfactor == 0 ? BTREE_DEFAULT_FILLFACTOR : fillfactor) + additional_bloat) / 100; entry->pages = (BlockNumber) (entry->tuples * line_size * bloat_factor / usable_page_size); @@ -1875,8 +1882,8 @@ hypo_estimate_index(hypoIndex *entry, RelOptInfo *rel, PlannerInfo *root) * BRIN access method does not bloat, don't add any additional. */ - entry->pages = 1 /* root page */ - + (ranges / REVMAP_PAGE_MAXITEMS) + 1; /* revmap */ + entry->pages = 1 /* root page */ + + (ranges / REVMAP_PAGE_MAXITEMS) + 1; /* revmap */ /* get the operator class name */ ht_opc = SearchSysCache1(CLAOID, @@ -1927,9 +1934,9 @@ hypo_estimate_index(hypoIndex *entry, RelOptInfo *rel, PlannerInfo *root) line_size = BLOOMTUPLEHDRSZ + sizeof_SignType * bloomLength; - entry->pages = 1; /* meta page */ + entry->pages = 1; /* meta page */ entry->pages += (BlockNumber) ceil( - ((double) entry->tuples * line_size) / usable_page_size); + ((double) entry->tuples * line_size) / usable_page_size); } #endif else @@ -1950,8 +1957,9 @@ hypo_estimate_index(hypoIndex *entry, RelOptInfo *rel, PlannerInfo *root) static int hypo_estimate_index_colsize(hypoIndex *entry, int col) { - int i, pos; - Node *expr; + int i, + pos; + Node *expr; /* If simple attribute, return avg width */ if (entry->indexkeys[col] != 0) @@ -1960,7 +1968,7 @@ hypo_estimate_index_colsize(hypoIndex *entry, int col) /* It's an expression */ pos = 0; - for (i=0; iindexkeys[i] == 0) @@ -1969,41 +1977,41 @@ hypo_estimate_index_colsize(hypoIndex *entry, int col) expr = (Node *) list_nth(entry->indexprs, pos); - if (IsA(expr, Var) && ((Var *) expr)->varattno != InvalidAttrNumber) + if (IsA(expr, Var) &&((Var *) expr)->varattno != InvalidAttrNumber) return get_attavgwidth(entry->relid, ((Var *) expr)->varattno); if (IsA(expr, FuncExpr)) { - FuncExpr *funcexpr = (FuncExpr *) expr; + FuncExpr *funcexpr = (FuncExpr *) expr; switch (funcexpr->funcid) { case 2311: /* md5 */ return 32; - break; + break; case 870: case 871: - { - /* lower and upper, detect if simple attr */ - Var *var; - - if (IsA(linitial(funcexpr->args), Var)) { - var = (Var *) linitial(funcexpr->args); + /* lower and upper, detect if simple attr */ + Var *var; - if (var->varattno > 0) - return get_attavgwidth(entry->relid, var->varattno); + if (IsA(linitial(funcexpr->args), Var)) + { + var = (Var *) linitial(funcexpr->args); + + if (var->varattno > 0) + return get_attavgwidth(entry->relid, var->varattno); + } + break; } - break; - } default: /* default fallback estimate will be used */ - break; + break; } } - return 50; /* default fallback estimate */ + return 50; /* default fallback estimate */ } /* diff --git a/hypopg_table.c b/hypopg_table.c index ed9f5fe..b3d3180 100644 --- a/hypopg_table.c +++ b/hypopg_table.c @@ -60,7 +60,7 @@ #endif #include "utils/ruleutils.h" #include "utils/syscache.h" -#endif /* pg10+ */ +#endif /* pg10+ */ #include "include/hypopg.h" #include "include/hypopg_analyze.h" @@ -80,37 +80,38 @@ PG_FUNCTION_INFO_V1(hypopg_reset_table); PG_FUNCTION_INFO_V1(hypopg_table); -#if PG_VERSION_NUM >= 100000 /* closed just before the SQL wrapper */ +#if PG_VERSION_NUM >= 100000 /* closed just before the SQL wrapper */ static void hypo_initTablesHash(); -static int hypo_expand_partitioned_entry(PlannerInfo *root, Oid - relationObjectId, RelOptInfo *rel, Relation parentrel, - hypoTable *branch, int firstpos, int parent_rti +static int +hypo_expand_partitioned_entry(PlannerInfo *root, Oid + relationObjectId, RelOptInfo *rel, Relation parentrel, + hypoTable *branch, int firstpos, int parent_rti #if PG_VERSION_NUM < 110000 - ,List **partitioned_child_rels + ,List **partitioned_child_rels #endif - ); +); static void hypo_expand_single_inheritance_child(PlannerInfo *root, - Oid relationObjectId, RelOptInfo *rel, Relation parentrel, - hypoTable *branch, RangeTblEntry *rte, hypoTable *child, Oid newrelid, - int parent_rti, bool expandBranch); + Oid relationObjectId, RelOptInfo *rel, Relation parentrel, + hypoTable *branch, RangeTblEntry *rte, hypoTable *child, Oid newrelid, + int parent_rti, bool expandBranch); static List *hypo_find_inheritance_children(hypoTable *parent); #if PG_VERSION_NUM < 110000 static List *hypo_find_all_inheritors(Oid parentrelId, List **numparents); #endif static List *hypo_get_qual_from_partbound(hypoTable *parent, - PartitionBoundSpec *spec); + PartitionBoundSpec *spec); static PartitionDesc hypo_generate_partitiondesc(hypoTable *parent); static void hypo_generate_partkey(CreateStmt *stmt, Oid parentid, - hypoTable *entry); + hypoTable *entry); #if PG_VERSION_NUM >= 110000 static PartitionScheme hypo_find_partition_scheme(PlannerInfo *root, - PartitionKey partkey); + PartitionKey partkey); static void hypo_generate_partition_key_exprs(hypoTable *entry, - RelOptInfo *rel); + RelOptInfo *rel); #endif static PartitionBoundSpec *hypo_get_boundspec(Oid tableid); #if PG_VERSION_NUM >= 110000 -static Oid hypo_get_default_partition_oid(hypoTable *parent); +static Oid hypo_get_default_partition_oid(hypoTable *parent); #endif static char *hypo_get_partbounddef(hypoTable *entry); static char *hypo_get_partkeydef(hypoTable *entry); @@ -124,20 +125,21 @@ static hypoTable *hypo_table_store_parsetree(CreateStmt *node, const char *queryString, hypoTable *parent, Oid rootid); static PartitionBoundSpec *hypo_transformPartitionBound(ParseState *pstate, - hypoTable *parent, PartitionBoundSpec *spec); + hypoTable *parent, PartitionBoundSpec *spec); #if PG_VERSION_NUM >= 110000 static void hypo_set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel, - hypoTable *entry); + hypoTable *entry); #endif static List *hypo_get_qual_for_list(hypoTable *parent, PartitionBoundSpec *spec); static List *hypo_get_qual_for_range(hypoTable *parent, PartitionBoundSpec *spec, - bool for_default); + bool for_default); static void hypo_check_new_partition_bound(char *relname, hypoTable *parent, - PartitionBoundSpec *spec); + PartitionBoundSpec *spec); /* Setup the hypoTables hash */ -static void hypo_initTablesHash() +static void +hypo_initTablesHash() { HASHCTL info; @@ -150,10 +152,10 @@ static void hypo_initTablesHash() info.hcxt = HypoMemoryContext; hypoTables = hash_create("hypo_tables", - 1024, - &info, - HASH_ELEM | HASH_BLOBS | HASH_CONTEXT - ); + 1024, + &info, + HASH_ELEM | HASH_BLOBS | HASH_CONTEXT + ); } /* @@ -166,20 +168,22 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, #if PG_VERSION_NUM < 110000 ,List **partitioned_child_rels #endif - ) +) { #if PG_VERSION_NUM < 110000 - List *inhOIDs; - ListCell *l; + List *inhOIDs; + ListCell *l; #else - hypoTable *parent; + hypoTable *parent; PartitionDesc partdesc; #endif - int nparts; + int nparts; RangeTblEntry *rte; - int newrelid, oldsize = root->simple_rel_array_size; - int i, j; - Oid *partoids; + int newrelid, + oldsize = root->simple_rel_array_size; + int i, + j; + Oid *partoids; Assert(hypo_table_oid_is_hypothetical(relationObjectId)); @@ -191,10 +195,11 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, #endif #if PG_VERSION_NUM < 110000 + /* * get all of the partition oids including a root table from - * hypo_find_all_inheritors, but remove the root table oid from - * the list since we expand a root table separately + * hypo_find_all_inheritors, but remove the root table oid from the list + * since we expand a root table separately */ inhOIDs = hypo_find_all_inheritors(relationObjectId, NULL); inhOIDs = list_delete_first(inhOIDs); @@ -218,14 +223,14 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, root->simple_rel_array = (RelOptInfo **) repalloc(root->simple_rel_array, - root->simple_rel_array_size * - sizeof(RelOptInfo *)); + root->simple_rel_array_size * + sizeof(RelOptInfo *)); root->simple_rte_array = (RangeTblEntry **) repalloc(root->simple_rte_array, - root->simple_rel_array_size * - sizeof(RangeTblEntry *)); + root->simple_rel_array_size * + sizeof(RangeTblEntry *)); - for (i=oldsize; isimple_rel_array_size; i++) + for (i = oldsize; i < root->simple_rel_array_size; i++) { root->simple_rel_array[i] = NULL; root->simple_rte_array[i] = NULL; @@ -234,7 +239,7 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, /* Get the rte from the root partition */ rte = root->simple_rte_array[rel->relid]; - /* if this is not the root partition, update the basic metadata */ + /* if this is not the root partition, update the basic metadata */ if (!branch) { Assert(parent_rti == -1); @@ -247,19 +252,19 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, firstpos); #endif } - else /* branch partition, expand it */ + else /* branch partition, expand it */ { /* The rte we retrieved has already been updated */ Assert(rte->relkind == RELKIND_PARTITIONED_TABLE); rte = copyObject(rte); - if(!rte->alias) + if (!rte->alias) rte->alias = makeNode(Alias); rte->alias->aliasname = branch->tablename; rte->inh = (nparts > 0); hypo_expand_single_inheritance_child(root, relationObjectId, rel, - parentrel, branch, rte, branch, firstpos, parent_rti, true); + parentrel, branch, rte, branch, firstpos, parent_rti, true); firstpos++; } @@ -269,34 +274,34 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, root->simple_rte_array[firstpos] = rte; root->parse->rtable = lappend(root->parse->rtable, - root->simple_rte_array[firstpos]); + root->simple_rte_array[firstpos]); HYPO_TAG_RTI(firstpos, root); /* - * if the table has no partition, we need to tell caller than it has to use - * the new position + * if the table has no partition, we need to tell caller than it has to + * use the new position */ if (nparts == 0) return firstpos + 1; /* - * create RangeTblEntries and AppendRelInfos hypothetically - * for all hypothetical partitions + * create RangeTblEntries and AppendRelInfos hypothetically for all + * hypothetical partitions */ newrelid = firstpos + 1; for (j = 0; j < nparts; j++) { - Oid childOid = partoids[j]; - hypoTable *child; - int ancestor; + Oid childOid = partoids[j]; + hypoTable *child; + int ancestor; /* - * if this is a branch partition, firstpos-1 is the ancestor - * rti of this rel. if not, rel->relid is the ancestor. + * if this is a branch partition, firstpos-1 is the ancestor rti of + * this rel. if not, rel->relid is the ancestor. */ if (branch) - ancestor = firstpos-1; + ancestor = firstpos - 1; else ancestor = rel->relid; @@ -315,7 +320,7 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, } #endif hypo_expand_single_inheritance_child(root, relationObjectId, rel, - parentrel, branch, rte, child, newrelid, ancestor, false); + parentrel, branch, rte, child, newrelid, ancestor, false); newrelid++; } @@ -333,9 +338,9 @@ hypo_expand_partitioned_entry(PlannerInfo *root, Oid relationObjectId, */ static void hypo_expand_single_inheritance_child(PlannerInfo *root, Oid relationObjectId, - RelOptInfo *rel, Relation parentrel, hypoTable *branch, - RangeTblEntry *rte, hypoTable *child, Oid newrelid, int parent_rti, - bool expandBranch) + RelOptInfo *rel, Relation parentrel, hypoTable *branch, + RangeTblEntry *rte, hypoTable *child, Oid newrelid, int parent_rti, + bool expandBranch) { RangeTblEntry *childrte; AppendRelInfo *appinfo; @@ -353,22 +358,25 @@ hypo_expand_single_inheritance_child(PlannerInfo *root, Oid relationObjectId, Assert(child == branch); } - childrte->relid = relationObjectId; //originalOID; + childrte->relid = relationObjectId; + //originalOID; if (child->partkey) childrte->relkind = RELKIND_PARTITIONED_TABLE; else childrte->relkind = RELKIND_RELATION; - if(!childrte->alias) + if (!childrte->alias) childrte->alias = makeNode(Alias); childrte->alias->aliasname = child->tablename; if (expandBranch) - HYPO_TABLE_RTE_SET_HYPOOID(childrte, branch->oid); // partitionOID - else - HYPO_TABLE_RTE_SET_HYPOOID(childrte, child->oid); // partitionOID + HYPO_TABLE_RTE_SET_HYPOOID(childrte, branch->oid); + //partitionOID + else + HYPO_TABLE_RTE_SET_HYPOOID(childrte, child->oid); + //partitionOID - root->simple_rte_array[newrelid] = childrte; + root->simple_rte_array[newrelid] = childrte; HYPO_TAG_RTI(newrelid, root); root->parse->rtable = lappend(root->parse->rtable, root->simple_rte_array[newrelid]); @@ -392,10 +400,10 @@ hypo_expand_single_inheritance_child(PlannerInfo *root, Oid relationObjectId, appinfo->parent_reltype = parentrel->rd_rel->reltype; appinfo->child_reltype = parentrel->rd_rel->reltype; make_inh_translation_list(parentrel, parentrel, newrelid, - &appinfo->translated_vars); + &appinfo->translated_vars); appinfo->parent_reloid = relationObjectId; root->append_rel_list = lappend(root->append_rel_list, - appinfo); + appinfo); } /* @@ -421,10 +429,11 @@ hypo_find_inheritance_children(hypoTable *parent) foreach(lc, parent->children) { - Oid childid = lfirst_oid(lc); + Oid childid = lfirst_oid(lc); oidarr[numoids++] = childid; } + /* * If we found more than one child, sort them by OID. This ensures * reasonably consistent behavior regardless of the vagaries of an @@ -591,6 +600,7 @@ hypo_generate_partitiondesc(hypoTable *parent) boundspec = (Node *) hypo_get_boundspec(inhrelid); #if PG_VERSION_NUM >= 110000 + /* * Sanity check: If the PartitionBoundSpec says this is the default * partition, its OID should correspond to whatever's stored in @@ -671,6 +681,7 @@ hypo_generate_partitiondesc(hypoTable *parent) elog(ERROR, "invalid strategy in partition bound spec"); #if PG_VERSION_NUM >= 110000 + /* * Note the index of the partition bound spec for the default * partition. There's no datum to add to the list of non-null @@ -764,6 +775,7 @@ hypo_generate_partitiondesc(hypoTable *parent) elog(ERROR, "invalid strategy in partition bound spec"); #if PG_VERSION_NUM >= 110000 + /* * Note the index of the partition bound spec for the default * partition. There's no datum to add to the allbounds array @@ -783,9 +795,9 @@ hypo_generate_partitiondesc(hypoTable *parent) false); #else lower = make_one_partition_rbound(key, i, spec->lowerdatums, - true); + true); upper = make_one_partition_rbound(key, i, spec->upperdatums, - false); + false); #endif all_bounds[ndatums++] = lower; all_bounds[ndatums++] = upper; @@ -794,10 +806,10 @@ hypo_generate_partitiondesc(hypoTable *parent) Assert(ndatums == nparts * 2 #if PG_VERSION_NUM >= 110000 - || + || (default_index != -1 && ndatums == (nparts - 1) * 2) #endif - ); + ); /* Sort all the bounds in ascending order */ qsort_arg(all_bounds, ndatums, @@ -1085,16 +1097,16 @@ hypo_generate_partitiondesc(hypoTable *parent) static void hypo_generate_partkey(CreateStmt *stmt, Oid parentid, hypoTable *entry) { - char strategy; - int partnatts; - AttrNumber partattrs[PARTITION_MAX_KEYS]; - Oid partopclass[PARTITION_MAX_KEYS]; - Oid partcollation[PARTITION_MAX_KEYS]; - List *partexprs = NIL; - Relation rel; - PartitionKey key; - int i; - MemoryContext oldcontext; + char strategy; + int partnatts; + AttrNumber partattrs[PARTITION_MAX_KEYS]; + Oid partopclass[PARTITION_MAX_KEYS]; + Oid partcollation[PARTITION_MAX_KEYS]; + List *partexprs = NIL; + Relation rel; + PartitionKey key; + int i; + MemoryContext oldcontext; Assert(stmt->partspec); @@ -1117,9 +1129,8 @@ hypo_generate_partkey(CreateStmt *stmt, Oid parentid, hypoTable *entry) /* * We need to transform the raw parsetrees corresponding to partition - * expressions into executable expression trees. Like column defaults - * and CHECK constraints, we could not have done the transformation - * earlier. + * expressions into executable expression trees. Like column defaults and + * CHECK constraints, we could not have done the transformation earlier. */ stmt->partspec = transformPartitionSpec(rel, stmt->partspec, &strategy); @@ -1132,115 +1143,115 @@ hypo_generate_partkey(CreateStmt *stmt, Oid parentid, hypoTable *entry) key->partexprs = partexprs; /*--- Adapted from RelationBuildPartitionKey ---*/ -{ - ListCell *partexprs_item; - int16 procnum; + { + ListCell *partexprs_item; + int16 procnum; - oldcontext = MemoryContextSwitchTo(HypoMemoryContext); + oldcontext = MemoryContextSwitchTo(HypoMemoryContext); - key->partopfamily = (Oid *) palloc0(key->partnatts * sizeof(Oid)); - key->partopcintype = (Oid *) palloc0(key->partnatts * sizeof(Oid)); - key->partsupfunc = (FmgrInfo *) palloc0(key->partnatts * sizeof(FmgrInfo)); + key->partopfamily = (Oid *) palloc0(key->partnatts * sizeof(Oid)); + key->partopcintype = (Oid *) palloc0(key->partnatts * sizeof(Oid)); + key->partsupfunc = (FmgrInfo *) palloc0(key->partnatts * sizeof(FmgrInfo)); - key->partcollation = (Oid *) palloc0(key->partnatts * sizeof(Oid)); + key->partcollation = (Oid *) palloc0(key->partnatts * sizeof(Oid)); - /* Gather type and collation info as well */ - key->parttypid = (Oid *) palloc0(key->partnatts * sizeof(Oid)); - key->parttypmod = (int32 *) palloc0(key->partnatts * sizeof(int32)); - key->parttyplen = (int16 *) palloc0(key->partnatts * sizeof(int16)); - key->parttypbyval = (bool *) palloc0(key->partnatts * sizeof(bool)); - key->parttypalign = (char *) palloc0(key->partnatts * sizeof(char)); - key->parttypcoll = (Oid *) palloc0(key->partnatts * sizeof(Oid)); - key->partattrs = (int16 *) palloc0(key->partnatts * sizeof(int16)); + /* Gather type and collation info as well */ + key->parttypid = (Oid *) palloc0(key->partnatts * sizeof(Oid)); + key->parttypmod = (int32 *) palloc0(key->partnatts * sizeof(int32)); + key->parttyplen = (int16 *) palloc0(key->partnatts * sizeof(int16)); + key->parttypbyval = (bool *) palloc0(key->partnatts * sizeof(bool)); + key->parttypalign = (char *) palloc0(key->partnatts * sizeof(char)); + key->parttypcoll = (Oid *) palloc0(key->partnatts * sizeof(Oid)); + key->partattrs = (int16 *) palloc0(key->partnatts * sizeof(int16)); - entry->partopclass = (Oid *) palloc0(key->partnatts * sizeof(Oid)); + entry->partopclass = (Oid *) palloc0(key->partnatts * sizeof(Oid)); - MemoryContextSwitchTo(oldcontext); + MemoryContextSwitchTo(oldcontext); #if PG_VERSION_NUM >= 110000 - /* determine support function number to search for */ - procnum = (key->strategy == PARTITION_STRATEGY_HASH) ? - HASHEXTENDED_PROC : BTORDER_PROC; + /* determine support function number to search for */ + procnum = (key->strategy == PARTITION_STRATEGY_HASH) ? + HASHEXTENDED_PROC : BTORDER_PROC; #else - procnum = BTORDER_PROC; + procnum = BTORDER_PROC; #endif - /* Copy partattrs and fill other per-attribute info */ - memcpy(key->partattrs, partattrs, key->partnatts * sizeof(int16)); - partexprs_item = list_head(key->partexprs); - for (i = 0; i < key->partnatts; i++) - { - AttrNumber attno = key->partattrs[i]; - HeapTuple opclasstup; - Form_pg_opclass opclassform; - Oid funcid; + /* Copy partattrs and fill other per-attribute info */ + memcpy(key->partattrs, partattrs, key->partnatts * sizeof(int16)); + partexprs_item = list_head(key->partexprs); + for (i = 0; i < key->partnatts; i++) + { + AttrNumber attno = key->partattrs[i]; + HeapTuple opclasstup; + Form_pg_opclass opclassform; + Oid funcid; - /* Collect opfamily information */ - opclasstup = SearchSysCache1(CLAOID, - ObjectIdGetDatum(partopclass[i])); - if (!HeapTupleIsValid(opclasstup)) - elog(ERROR, "cache lookup failed for opclass %u", partopclass[i]); + /* Collect opfamily information */ + opclasstup = SearchSysCache1(CLAOID, + ObjectIdGetDatum(partopclass[i])); + if (!HeapTupleIsValid(opclasstup)) + elog(ERROR, "cache lookup failed for opclass %u", partopclass[i]); - opclassform = (Form_pg_opclass) GETSTRUCT(opclasstup); - key->partopfamily[i] = opclassform->opcfamily; - key->partopcintype[i] = opclassform->opcintype; + opclassform = (Form_pg_opclass) GETSTRUCT(opclasstup); + key->partopfamily[i] = opclassform->opcfamily; + key->partopcintype[i] = opclassform->opcintype; - /* Get a support function for the specified opfamily and datatypes */ - funcid = get_opfamily_proc(opclassform->opcfamily, - opclassform->opcintype, - opclassform->opcintype, - procnum); - if (!OidIsValid(funcid)) + /* Get a support function for the specified opfamily and datatypes */ + funcid = get_opfamily_proc(opclassform->opcfamily, + opclassform->opcintype, + opclassform->opcintype, + procnum); + if (!OidIsValid(funcid)) #if PG_VERSION_NUM >= 110000 - ereport(ERROR, - (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), - errmsg("operator class \"%s\" of access method %s is missing support function %d for type %s", - NameStr(opclassform->opcname), - (key->strategy == PARTITION_STRATEGY_HASH) ? "hash" : "btree", - procnum, - format_type_be(opclassform->opcintype)))); + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("operator class \"%s\" of access method %s is missing support function %d for type %s", + NameStr(opclassform->opcname), + (key->strategy == PARTITION_STRATEGY_HASH) ? "hash" : "btree", + procnum, + format_type_be(opclassform->opcintype)))); #else - ereport(ERROR, - (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), - errmsg("operator class \"%s\" of access method %s is missing support function %d for type %s", - NameStr(opclassform->opcname), - "btree", - procnum, - format_type_be(opclassform->opcintype)))); -#endif - fmgr_info(funcid, &key->partsupfunc[i]); + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("operator class \"%s\" of access method %s is missing support function %d for type %s", + NameStr(opclassform->opcname), + "btree", + procnum, + format_type_be(opclassform->opcintype)))); +#endif + fmgr_info(funcid, &key->partsupfunc[i]); - /* Collation */ - key->partcollation[i] = partcollation[i]; + /* Collation */ + key->partcollation[i] = partcollation[i]; - /* Collect type information */ - if (attno != 0) - { - Form_pg_attribute att = TupleDescAttr(rel->rd_att, attno - 1); + /* Collect type information */ + if (attno != 0) + { + Form_pg_attribute att = TupleDescAttr(rel->rd_att, attno - 1); - key->parttypid[i] = att->atttypid; - key->parttypmod[i] = att->atttypmod; - key->parttypcoll[i] = att->attcollation; + key->parttypid[i] = att->atttypid; + key->parttypmod[i] = att->atttypmod; + key->parttypcoll[i] = att->attcollation; + } + else + { + if (partexprs_item == NULL) + elog(ERROR, "wrong number of partition key expressions"); + + key->parttypid[i] = exprType(lfirst(partexprs_item)); + key->parttypmod[i] = exprTypmod(lfirst(partexprs_item)); + key->parttypcoll[i] = exprCollation(lfirst(partexprs_item)); + + partexprs_item = lnext(partexprs_item); + } + get_typlenbyvalalign(key->parttypid[i], + &key->parttyplen[i], + &key->parttypbyval[i], + &key->parttypalign[i]); + + ReleaseSysCache(opclasstup); } - else - { - if (partexprs_item == NULL) - elog(ERROR, "wrong number of partition key expressions"); - - key->parttypid[i] = exprType(lfirst(partexprs_item)); - key->parttypmod[i] = exprTypmod(lfirst(partexprs_item)); - key->parttypcoll[i] = exprCollation(lfirst(partexprs_item)); - - partexprs_item = lnext(partexprs_item); - } - get_typlenbyvalalign(key->parttypid[i], - &key->parttyplen[i], - &key->parttypbyval[i], - &key->parttypalign[i]); - - ReleaseSysCache(opclasstup); } -} heap_close(rel, AccessShareLock); @@ -1278,8 +1289,8 @@ hypo_find_partition_scheme(PlannerInfo *root, PartitionKey partkey) { PartitionScheme part_scheme; int partnatts, - i; - ListCell *lc; + i; + ListCell *lc; Assert(CurrentMemoryContext != HypoMemoryContext); @@ -1348,9 +1359,9 @@ hypo_find_partition_scheme(PlannerInfo *root, PartitionKey partkey) part_scheme->partcollation = (Oid *) palloc(sizeof(Oid) * partnatts); memcpy(part_scheme->partcollation, partkey->partcollation, sizeof(Oid) * partnatts); - //part_scheme->parttypcoll = (Oid *) palloc(sizeof(Oid) * partnatts); - //memcpy(part_scheme->parttypcoll, partkey->parttypcoll, - // sizeof(Oid) * partnatts); + /* part_scheme->parttypcoll = (Oid *) palloc(sizeof(Oid) * partnatts); */ + /* memcpy(part_scheme->parttypcoll, partkey->parttypcoll, */ + /* sizeof(Oid) * partnatts); */ part_scheme->parttyplen = (int16 *) palloc(sizeof(int16) * partnatts); memcpy(part_scheme->parttyplen, partkey->parttyplen, @@ -1435,7 +1446,7 @@ hypo_generate_partition_key_exprs(hypoTable *entry, RelOptInfo *rel) */ rel->nullable_partexprs = (List **) palloc0(sizeof(List *) * partnatts); } -#endif /* pg11+ */ +#endif /* pg11+ */ /* * Return the PartitionBoundSpec associated to a partition if any, otherwise @@ -1444,7 +1455,7 @@ hypo_generate_partition_key_exprs(hypoTable *entry, RelOptInfo *rel) static PartitionBoundSpec * hypo_get_boundspec(Oid tableid) { - hypoTable *entry = hypo_find_table(tableid, true); + hypoTable *entry = hypo_find_table(tableid, true); if (entry) return entry->boundspec; @@ -1460,7 +1471,7 @@ hypo_get_boundspec(Oid tableid) static Oid hypo_get_default_partition_oid(hypoTable *parent) { - ListCell *lc; + ListCell *lc; foreach(lc, parent->children) { @@ -1482,8 +1493,8 @@ hypo_get_default_partition_oid(hypoTable *parent) static char * hypo_get_partbounddef(hypoTable *entry) { - StringInfoData _buf; - StringInfo buf; + StringInfoData _buf; + StringInfo buf; PartitionBoundSpec *spec = entry->boundspec; ListCell *cell; char *sep; @@ -1561,8 +1572,8 @@ hypo_get_partbounddef(hypoTable *entry) static char * hypo_get_partkeydef(hypoTable *entry) { - StringInfoData buf; - PartitionKey partkey = entry->partkey; + StringInfoData buf; + PartitionKey partkey = entry->partkey; Oid relid; ListCell *partexpr_item; List *context; @@ -1572,7 +1583,7 @@ hypo_get_partkeydef(hypoTable *entry) if (!partkey) elog(ERROR, "hypopg: hypothetical table %s is not partitioned", - quote_identifier(entry->tablename)); + quote_identifier(entry->tablename)); relid = entry->rootid; @@ -1581,7 +1592,7 @@ hypo_get_partkeydef(hypoTable *entry) initStringInfo(&buf); appendStringInfo(&buf, "PARTITION BY "); - switch(partkey->strategy) + switch (partkey->strategy) { #if PG_VERSION_NUM >= 110000 case PARTITION_STRATEGY_HASH: @@ -1596,7 +1607,7 @@ hypo_get_partkeydef(hypoTable *entry) break; default: elog(ERROR, "hypopg: unexpected partition strategy %d", - (int) partkey->strategy); + (int) partkey->strategy); } appendStringInfoString(&buf, " ("); @@ -1673,10 +1684,10 @@ hypo_get_partkeydef(hypoTable *entry) static void hypo_table_check_constraints_compatibility(hypoTable *table) { - Relation rel = heap_open(table->rootid, AccessShareLock); - List *idxlist = RelationGetIndexList(rel); - PartitionKey key = table->partkey; - ListCell *lc; + Relation rel = heap_open(table->rootid, AccessShareLock); + List *idxlist = RelationGetIndexList(rel); + PartitionKey key = table->partkey; + ListCell *lc; /* The partey should have already been generated */ Assert(key); @@ -1684,10 +1695,10 @@ hypo_table_check_constraints_compatibility(hypoTable *table) /* adapted from DefineIndex */ foreach(lc, idxlist) { - Relation idxRel = index_open(lfirst_oid(lc), AccessShareLock); - IndexInfo *indexInfo = BuildIndexInfo(idxRel); - Form_pg_index index; - int i; + Relation idxRel = index_open(lfirst_oid(lc), AccessShareLock); + IndexInfo *indexInfo = BuildIndexInfo(idxRel); + Form_pg_index index; + int i; index = idxRel->rd_index; @@ -1723,6 +1734,7 @@ hypo_table_check_constraints_compatibility(hypoTable *table) { bool found = false; int j; + /* FIXME detect the real constraint type */ const char *constraint_type = "unique"; @@ -1772,13 +1784,14 @@ hypo_table_check_constraints_compatibility(hypoTable *table) int i; if ((idx->relid != table->rootid && idx->relid != table->oid) || - !idx->unique) + !idx->unique) continue; for (i = 0; i < key->partnatts; i++) { bool found = false; int j; + /* FIXME detect the real constraint type */ const char *constraint_type = "unique"; @@ -1825,10 +1838,10 @@ hypo_table_check_constraints_compatibility(hypoTable *table) static hypoTable * hypo_newTable(Oid parentid) { - Oid entryid; - hypoTable *entry; - hypoTable *parent; - bool found; + Oid entryid; + hypoTable *entry; + hypoTable *parent; + bool found; if (!hypoTables) hypo_initTablesHash(); @@ -1837,14 +1850,14 @@ hypo_newTable(Oid parentid) * If the given root table oid isn't present in hypoTables, we're * partitioning it, so keep its oid, otherwise generate a new oid */ - parent= hypo_table_find_parent_oid(parentid); + parent = hypo_table_find_parent_oid(parentid); if (parent) entryid = hypo_getNewOid(parent->rootid); else entryid = parentid; entry = (hypoTable *) hash_search(hypoTables, &entryid, HASH_ENTER, - &found); + &found); Assert(!found); @@ -1852,12 +1865,12 @@ hypo_newTable(Oid parentid) entry->oid = entryid; - entry->set_tuples = false; /* wil be generated later if needed */ - entry->tuples = 0; /* wil be generated later if needed */ - entry->children = NIL; /* maintained add child creation */ - entry->boundspec = NULL; /* wil be generated later if needed */ - entry->partkey = NULL; /* wil be generated later if needed */ - entry->valid = false; /* set to true when all initialization is done */ + entry->set_tuples = false; /* wil be generated later if needed */ + entry->tuples = 0; /* wil be generated later if needed */ + entry->children = NIL; /* maintained add child creation */ + entry->boundspec = NULL; /* wil be generated later if needed */ + entry->partkey = NULL; /* wil be generated later if needed */ + entry->valid = false; /* set to true when all initialization is done */ if (parent) { @@ -1912,8 +1925,8 @@ hypo_find_table(Oid tableid, bool missing_ok) hypoTable * hypo_table_name_get_entry(const char *name) { - HASH_SEQ_STATUS hash_seq; - hypoTable *entry; + HASH_SEQ_STATUS hash_seq; + hypoTable *entry; hash_seq_init(&hash_seq, hypoTables); while ((entry = hash_seq_search(&hash_seq)) != NULL) @@ -1997,7 +2010,7 @@ hypo_table_remove(Oid tableid, hypoTable *parent, bool deep) { hypoTable *entry; - if(!hypoTables) + if (!hypoTables) return false; entry = hypo_find_table(tableid, true); @@ -2008,7 +2021,7 @@ hypo_table_remove(Oid tableid, hypoTable *parent, bool deep) /* in deep mode, we need to process the inherited children first */ if (deep) { - ListCell *lc; + ListCell *lc; /* * The children will be removed during this loop, so we can't iterate @@ -2017,7 +2030,7 @@ hypo_table_remove(Oid tableid, hypoTable *parent, bool deep) lc = list_head(entry->children); while (lc != NULL) { - Oid childid = lfirst_oid(lc); + Oid childid = lfirst_oid(lc); /* get the next cell right now, before we remove the entry */ lc = lnext(lc); @@ -2057,8 +2070,8 @@ hypo_table_remove(Oid tableid, hypoTable *parent, bool deep) void hypo_table_reset(void) { - HASH_SEQ_STATUS hash_seq; - hypoTable *entry; + HASH_SEQ_STATUS hash_seq; + hypoTable *entry; if (!hypoTables) return; @@ -2080,15 +2093,15 @@ hypo_table_reset(void) */ static hypoTable * hypo_table_store_parsetree(CreateStmt *node, const char *queryString, - hypoTable *parent, Oid rootid) + hypoTable *parent, Oid rootid) { /* must be declared "volatile", because used in a PG_CATCH() */ - hypoTable *volatile entry; - List *stmts; - CreateStmt *stmt = NULL; - ListCell *lc; + hypoTable *volatile entry; + List *stmts; + CreateStmt *stmt = NULL; + ListCell *lc; PartitionBoundSpec *boundspec; - MemoryContext oldcontext; + MemoryContext oldcontext; Assert(CurrentMemoryContext != HypoMemoryContext); @@ -2108,7 +2121,7 @@ hypo_table_store_parsetree(CreateStmt *node, const char *queryString, if (!stmt) elog(ERROR, "hypopg: wrong invocation of %s", - (parent ? "hypopg_add_partition" : "hypopg_partition_table")); + (parent ? "hypopg_add_partition" : "hypopg_partition_table")); boundspec = stmt->partbound; @@ -2127,6 +2140,7 @@ hypo_table_store_parsetree(CreateStmt *node, const char *queryString, { hypo_generate_partkey(stmt, rootid, entry); #if PG_VERSION_NUM >= 110000 + /* * Make sure that the partitioning clause is compatible with * existing constraints @@ -2146,12 +2160,12 @@ hypo_table_store_parsetree(CreateStmt *node, const char *queryString, oldcontext = MemoryContextSwitchTo(HypoMemoryContext); entry->boundspec = hypo_transformPartitionBound(pstate, - parent, boundspec); + parent, boundspec); MemoryContextSwitchTo(oldcontext); hypo_check_new_partition_bound(node->relation->relname, - parent, - entry->boundspec); + parent, + entry->boundspec); } if (parent) @@ -2195,7 +2209,7 @@ hypo_table_store_parsetree(CreateStmt *node, const char *queryString, */ static PartitionBoundSpec * hypo_transformPartitionBound(ParseState *pstate, hypoTable *parent, - PartitionBoundSpec *spec) + PartitionBoundSpec *spec) { PartitionBoundSpec *result_spec; PartitionKey key = parent->partkey; @@ -2419,20 +2433,20 @@ hypo_transformPartitionBound(ParseState *pstate, hypoTable *parent, */ void hypo_injectHypotheticalPartitioning(PlannerInfo *root, - Oid relationObjectId, - RelOptInfo *rel) + Oid relationObjectId, + RelOptInfo *rel) { Assert(hypo_table_oid_is_hypothetical(relationObjectId)); /* - * if this rel is parent, prepare some structures to inject - * hypothetical partitioning + * if this rel is parent, prepare some structures to inject hypothetical + * partitioning */ - if(!HYPO_RTI_IS_TAGGED(rel->relid,root)) + if (!HYPO_RTI_IS_TAGGED(rel->relid, root)) { - Relation parentrel; + Relation parentrel; #if PG_VERSION_NUM < 110000 - List *partitioned_child_rels = NIL; + List *partitioned_child_rels = NIL; PartitionedChildRelInfo *pcinfo; #endif @@ -2460,34 +2474,34 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root, /* * If this rel is a partition, we set rel->pages and rel->tuples. * - * When hypoTable->set_tuples is true, pages and tuples are set - * according to hypoTable->tuples. Otherwise, we will estimate pages - * and tuples here according to its partition bound and root table's - * pages and tuples as follows: - * In the case of RANGE/LIST partitioning, we will compute selectivity - * according to the partition constraints including its ancestors'. - * On the other hand, in the case of HASH partitioning, we will multiply - * the number of partitions including its ancestors'. After that we will - * compute pages and tuples using the selectivity and the product of the - * number of partitions. + * When hypoTable->set_tuples is true, pages and tuples are set according + * to hypoTable->tuples. Otherwise, we will estimate pages and tuples + * here according to its partition bound and root table's pages and tuples + * as follows: In the case of RANGE/LIST partitioning, we will compute + * selectivity according to the partition constraints including its + * ancestors'. On the other hand, in the case of HASH partitioning, we + * will multiply the number of partitions including its ancestors'. After + * that we will compute pages and tuples using the selectivity and the + * product of the number of partitions. */ if (rel->reloptkind != RELOPT_BASEREL - &&HYPO_RTI_IS_TAGGED(rel->relid,root)) + && HYPO_RTI_IS_TAGGED(rel->relid, root)) { - Oid partoid; - hypoTable *part; + Oid partoid; + hypoTable *part; #if PG_VERSION_NUM >= 110000 - hypoTable *cur_part; + hypoTable *cur_part; #endif RangeTblEntry *rte = planner_rt_fetch(rel->relid, root); Selectivity selectivity; - double pages; - int total_modulus = 1; + double pages; + int total_modulus = 1; Assert(HYPO_TABLE_RTE_HAS_HYPOOID(rte)); partoid = HYPO_TABLE_RTE_GET_HYPOOID(rte); part = hypo_find_table(partoid, false); #if PG_VERSION_NUM >= 110000 + /* * there's no need to estimate branch partitions pages and tuples, but * we have to setup their partitioning data if the partition has @@ -2501,15 +2515,15 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root, /* * Selectivity for hash partitions cannot be done using the standard - * clauselist_selectivity(), because the underlying constraint is using - * the satisfies_hash_partition() function, for which we won't be able - * to get sensible estimation. Instead, compute a fraction based on - * this partition modulus, multiplied by all its hash partitions' - * ancestor modulus if any and use it to correct the estimation we find - * for all non-hash partitions + * clauselist_selectivity(), because the underlying constraint is + * using the satisfies_hash_partition() function, for which we won't + * be able to get sensible estimation. Instead, compute a fraction + * based on this partition modulus, multiplied by all its hash + * partitions' ancestor modulus if any and use it to correct the + * estimation we find for all non-hash partitions */ cur_part = part; - for(;;) + for (;;) { if (cur_part->boundspec->strategy == PARTITION_STRATEGY_HASH) total_modulus *= cur_part->boundspec->modulus; @@ -2521,7 +2535,7 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root, break; } elog(DEBUG1, "hypopg: total modulus for partition %s: %d", - part->tablename, total_modulus); + part->tablename, total_modulus); #else Assert(total_modulus == 1); #endif @@ -2530,8 +2544,8 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root, { /* * pages and tuples are set according to part->tuples got by - * hypopg_analyze function. But we need compute them again - * using total_modulus for hash partitioning, since hypopg_analyze + * hypopg_analyze function. But we need compute them again using + * total_modulus for hash partitioning, since hypopg_analyze * cannot run on hash partitioning */ pages = ceil(rel->pages * part->tuples / rel->tuples / total_modulus); @@ -2541,8 +2555,8 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root, else { /* - * hypo_clauselist_selectivity will retrieve the constraints for this - * partition and all its ancestors + * hypo_clauselist_selectivity will retrieve the constraints for + * this partition and all its ancestors */ selectivity = hypo_clauselist_selectivity(root, rel, NIL, part->rootid, part->parentid); @@ -2559,6 +2573,7 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root, } #if PG_VERSION_NUM >= 110000 + /* * This is done in query_planner just before add_base_rels_to_query() is * called, so before get_relation_info_hook is called and setup @@ -2585,14 +2600,14 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root, */ void hypo_markDummyIfExcluded(PlannerInfo *root, RelOptInfo *rel, - Index rti, RangeTblEntry *rte) + Index rti, RangeTblEntry *rte) { - List *constraints; - List *safe_constraints = NIL; - ListCell *lc; - Oid partoid = HYPO_TABLE_RTE_GET_HYPOOID(rte); - hypoTable *part = hypo_find_table(partoid, false); - hypoTable *parent = hypo_find_table(part->parentid, false); + List *constraints; + List *safe_constraints = NIL; + ListCell *lc; + Oid partoid = HYPO_TABLE_RTE_GET_HYPOOID(rte); + hypoTable *part = hypo_find_table(partoid, false); + hypoTable *parent = hypo_find_table(part->parentid, false); Assert(hypo_table_oid_is_hypothetical(rte->relid)); Assert(rte->relkind == 'r'); @@ -2609,22 +2624,22 @@ hypo_markDummyIfExcluded(PlannerInfo *root, RelOptInfo *rel, */ foreach(lc, constraints) { - Node *pred = (Node *) lfirst(lc); + Node *pred = (Node *) lfirst(lc); if (!contain_mutable_functions(pred)) safe_constraints = lappend(safe_constraints, pred); } /* - * if this partition need not be scanned, we call the set_dummy_rel_pathlist() - * to mark it as dummy + * if this partition need not be scanned, we call the + * set_dummy_rel_pathlist() to mark it as dummy */ if (predicate_refuted_by(safe_constraints, rel->baserestrictinfo, false)) set_dummy_rel_pathlist(rel); /* - TODO: re-estimate parent size just like set_append_rel_size() - */ + * TODO: re-estimate parent size just like set_append_rel_size() + */ } @@ -2639,13 +2654,13 @@ hypo_markDummyIfExcluded(PlannerInfo *root, RelOptInfo *rel, */ static void hypo_set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel, - hypoTable *entry) + hypoTable *entry) { PartitionDesc partdesc; PartitionKey partkey; Assert(planner_rt_fetch(rel->relid, root)->relkind == - RELKIND_PARTITIONED_TABLE); + RELKIND_PARTITIONED_TABLE); partdesc = hypo_generate_partitiondesc(entry); @@ -2659,9 +2674,10 @@ hypo_set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel, /* Add the partition_qual if it's not the root partition */ if (OidIsValid(entry->parentid)) { - hypoTable *parent = hypo_find_table(entry->parentid, false); + hypoTable *parent = hypo_find_table(entry->parentid, false); + rel->partition_qual = hypo_get_partition_constraints(root, rel, parent, - false); + false); } } #endif @@ -2680,12 +2696,12 @@ hypo_set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel, */ List * hypo_get_partition_constraints(PlannerInfo *root, RelOptInfo *rel, - hypoTable *parent, bool force_generation) + hypoTable *parent, bool force_generation) { - Index varno = rel->relid; - Oid childOid; - hypoTable *child; - List *pcqual; + Index varno = rel->relid; + Oid childOid; + hypoTable *child; + List *pcqual; childOid = HYPO_TABLE_RTI_GET_HYPOOID(rel->relid, root); child = hypo_find_table(childOid, false); @@ -2697,12 +2713,12 @@ hypo_get_partition_constraints(PlannerInfo *root, RelOptInfo *rel, #if PG_VERSION_NUM >= 110000 Assert( - (force_generation && - list_length(root->parse->rtable) == 1 && - root->parse->commandType == CMD_UNKNOWN && - hypo_table_oid_is_hypothetical(root->simple_rte_array[1]->relid)) - || !force_generation - ); + (force_generation && + list_length(root->parse->rtable) == 1 && + root->parse->commandType == CMD_UNKNOWN && + hypo_table_oid_is_hypothetical(root->simple_rte_array[1]->relid)) + || !force_generation + ); /* * For selects, partition pruning uses the parent table's partition bound @@ -2710,24 +2726,24 @@ hypo_get_partition_constraints(PlannerInfo *root, RelOptInfo *rel, * individual partition's partition constraint. */ if ((enable_partition_pruning && root->parse->commandType != CMD_SELECT) - || force_generation) + || force_generation) { #endif - if (pcqual) - { - /* - * Run the partition quals through const-simplification similar to - * check constraints. We skip canonicalize_qual, though, because - * partition quals should be in canonical form already; also, since - * the qual is in implicit-AND format, we'd have to explicitly convert - * it to explicit-AND format and back again. - */ - pcqual = (List *) eval_const_expressions(root, (Node *) pcqual); + if (pcqual) + { + /* + * Run the partition quals through const-simplification similar to + * check constraints. We skip canonicalize_qual, though, because + * partition quals should be in canonical form already; also, + * since the qual is in implicit-AND format, we'd have to + * explicitly convert it to explicit-AND format and back again. + */ + pcqual = (List *) eval_const_expressions(root, (Node *) pcqual); - /* Fix Vars to have the desired varno */ - if (varno != 1) - ChangeVarNodes((Node *) pcqual, 1, varno, 0); - } + /* Fix Vars to have the desired varno */ + if (varno != 1) + ChangeVarNodes((Node *) pcqual, 1, varno, 0); + } #if PG_VERSION_NUM >= 110000 } #endif @@ -2743,7 +2759,7 @@ List * hypo_get_partition_quals_inh(hypoTable *part, hypoTable *parent) { PartitionBoundSpec *spec; - List *constraints = NIL; + List *constraints = NIL; Assert(OidIsValid(part->parentid)); @@ -2757,7 +2773,7 @@ hypo_get_partition_quals_inh(hypoTable *part, hypoTable *parent) /* Append parent's constraint if any */ if (OidIsValid(parent->parentid)) { - List *parent_constraints; + List *parent_constraints; parent_constraints = hypo_get_partition_quals_inh(parent, NULL); @@ -2778,7 +2794,7 @@ static List * hypo_get_qual_from_partbound(hypoTable *parent, PartitionBoundSpec *spec) { PartitionKey key = parent->partkey; - List *my_qual = NIL; + List *my_qual = NIL; Assert(key != NULL); @@ -2786,29 +2802,30 @@ hypo_get_qual_from_partbound(hypoTable *parent, PartitionBoundSpec *spec) { #if PG_VERSION_NUM >= 110000 - case PARTITION_STRATEGY_HASH: - Assert(spec->strategy == PARTITION_STRATEGY_HASH); - /* - * Do not add the qual for hash partitioning, see comment in - * hypo_injectHypotheticalPartitioning about hash partitioning - * selectivity estimation - */ - break; + case PARTITION_STRATEGY_HASH: + Assert(spec->strategy == PARTITION_STRATEGY_HASH); + + /* + * Do not add the qual for hash partitioning, see comment in + * hypo_injectHypotheticalPartitioning about hash partitioning + * selectivity estimation + */ + break; #endif - case PARTITION_STRATEGY_LIST: - Assert(spec->strategy == PARTITION_STRATEGY_LIST); - my_qual = hypo_get_qual_for_list(parent, spec); - break; + case PARTITION_STRATEGY_LIST: + Assert(spec->strategy == PARTITION_STRATEGY_LIST); + my_qual = hypo_get_qual_for_list(parent, spec); + break; - case PARTITION_STRATEGY_RANGE: - Assert(spec->strategy == PARTITION_STRATEGY_RANGE); - my_qual = hypo_get_qual_for_range(parent, spec, false); - break; + case PARTITION_STRATEGY_RANGE: + Assert(spec->strategy == PARTITION_STRATEGY_RANGE); + my_qual = hypo_get_qual_for_range(parent, spec, false); + break; - default: - elog(ERROR, "unexpected partition strategy: %d", - (int) key->strategy); + default: + elog(ERROR, "unexpected partition strategy: %d", + (int) key->strategy); } return my_qual; @@ -2851,6 +2868,7 @@ hypo_get_qual_for_list(hypoTable *parent, PartitionBoundSpec *spec) keyCol = (Expr *) copyObject(linitial(key->partexprs)); #if PG_VERSION_NUM >= 110000 + /* * For default list partition, collect datums for all the partitions. The * default partition constraint should check that the partition key is @@ -2974,6 +2992,7 @@ hypo_get_qual_for_list(hypoTable *parent, PartitionBoundSpec *spec) } #if PG_VERSION_NUM >= 110000 + /* * Note that, in general, applying NOT to a constraint expression doesn't * necessarily invert the set of rows it accepts, because NOT (NULL) is @@ -3035,12 +3054,12 @@ hypo_get_qual_for_range(hypoTable *parent, PartitionBoundSpec *spec, bool for_de for (i = 0; i < nparts; i++) { Oid inhrelid = inhoids[i]; - hypoTable *part; + hypoTable *part; PartitionBoundSpec *bspec; /* - * get each partition's boundspec from hypoTable entry - * instead of catalog + * get each partition's boundspec from hypoTable entry instead of + * catalog */ part = hypo_find_table(inhrelid, false); bspec = part->boundspec; @@ -3350,7 +3369,7 @@ hypo_get_qual_for_range(hypoTable *parent, PartitionBoundSpec *spec, bool for_de */ static void hypo_check_new_partition_bound(char *relname, hypoTable *parent, - PartitionBoundSpec *spec) + PartitionBoundSpec *spec) { PartitionKey key = parent->partkey; PartitionDesc partdesc = hypo_generate_partitiondesc(parent); @@ -3481,7 +3500,7 @@ hypo_check_new_partition_bound(char *relname, hypoTable *parent, #if PG_VERSION_NUM >= 110000 || partition_bound_has_default(boundinfo) #endif - )); + )); foreach(cell, spec->listdatums) { @@ -3494,8 +3513,8 @@ hypo_check_new_partition_bound(char *relname, hypoTable *parent, #if PG_VERSION_NUM < 110000 offset = partition_bound_bsearch(key, boundinfo, - &val->constvalue, - true, &equal); + &val->constvalue, + true, &equal); #else offset = partition_list_bsearch(&key->partsupfunc[0], key->partcollation, @@ -3572,7 +3591,7 @@ hypo_check_new_partition_bound(char *relname, hypoTable *parent, (boundinfo->ndatums > 0 || partition_bound_has_default(boundinfo)) #endif - ); + ); /* * Test whether the new lower bound (which is treated @@ -3613,8 +3632,8 @@ hypo_check_new_partition_bound(char *relname, hypoTable *parent, int32 cmpval; #if PG_VERSION_NUM < 110000 cmpval = partition_bound_cmp(key, boundinfo, - offset + 1, upper, - true); + offset + 1, upper, + true); #else Datum *datums; PartitionRangeDatumKind *kind; @@ -3663,7 +3682,7 @@ hypo_check_new_partition_bound(char *relname, hypoTable *parent, if (overlap) { - hypoTable *table = hypo_find_table(partdesc->oids[with], false); + hypoTable *table = hypo_find_table(partdesc->oids[with], false); Assert(with >= 0); ereport(ERROR, @@ -3674,7 +3693,7 @@ hypo_check_new_partition_bound(char *relname, hypoTable *parent, } } -#endif /* pg10+ (~l. 81) */ +#endif /* pg10+ (~l. 81) */ /* * SQL wrapper to create an hypothetical partition with his parsetree @@ -3683,17 +3702,18 @@ Datum hypopg_add_partition(PG_FUNCTION_ARGS) { #if PG_VERSION_NUM < 100000 -HYPO_PARTITION_NOT_SUPPORTED(); + HYPO_PARTITION_NOT_SUPPORTED(); #else const char *partname = PG_GETARG_NAME(0)->data; char *partitionof = TextDatumGetCString(PG_GETARG_TEXT_PP(1)); char *partition_by = NULL; - StringInfoData sql; + StringInfoData sql; hypoTable *parent; - Oid parentid, rootid; + Oid parentid, + rootid; hypoTable *entry; List *parsetree_list; - RawStmt *raw_stmt; + RawStmt *raw_stmt; CreateStmt *stmt; RangeVar *rv; TupleDesc tupdesc; @@ -3712,11 +3732,11 @@ HYPO_PARTITION_NOT_SUPPORTED(); if (RelnameGetRelid(partname) != InvalidOid) elog(ERROR, "hypopg: real table %s already exists", - quote_identifier(partname)); + quote_identifier(partname)); if (hypo_table_name_get_entry(partname) != NULL) elog(ERROR, "hypopg: hypothetical table %s already exists", - quote_identifier(partname)); + quote_identifier(partname)); tupdesc = CreateTemplateTupleDesc(HYPO_ADD_PART_COLS, false); TupleDescInitEntry(tupdesc, (AttrNumber) ++i, "relid", OIDOID, -1, 0); @@ -3729,11 +3749,11 @@ HYPO_PARTITION_NOT_SUPPORTED(); initStringInfo(&sql); appendStringInfo(&sql, "CREATE TABLE %s %s", - quote_identifier(partname), partitionof); + quote_identifier(partname), partitionof); if (partition_by) appendStringInfo(&sql, " %s", - partition_by); + partition_by); parsetree_list = pg_parse_query(sql.data); raw_stmt = (RawStmt *) linitial(parsetree_list); @@ -3746,14 +3766,14 @@ HYPO_PARTITION_NOT_SUPPORTED(); /* Find the parent's oid */ if (list_length(stmt->inhRelations) != 1) elog(ERROR, "hypopg: unexpected list length %d, expected 1", - list_length(stmt->inhRelations)); + list_length(stmt->inhRelations)); rv = (RangeVar *) linitial(stmt->inhRelations); parentid = RangeVarGetRelid(rv, AccessShareLock, true); if (OidIsValid(parentid) && !hypo_table_oid_is_hypothetical(parentid)) elog(ERROR, "hypopg: %s must be hypothetically partitioned first", - quote_identifier(rv->relname)); + quote_identifier(rv->relname)); /* Look for a hypothetical parent if we didn't find a real table */ if (!OidIsValid(parentid)) @@ -3762,11 +3782,11 @@ HYPO_PARTITION_NOT_SUPPORTED(); if (parent == NULL) elog(ERROR, "hypopg: %s does not exists", - quote_identifier(rv->relname)); + quote_identifier(rv->relname)); - if(rv->schemaname) + if (rv->schemaname) elog(ERROR, "hypopg: cannot use qualified name with hypothetical" - " partition"); + " partition"); parentid = parent->oid; rootid = parent->rootid; @@ -3782,7 +3802,7 @@ HYPO_PARTITION_NOT_SUPPORTED(); } entry = hypo_table_store_parsetree((CreateStmt *) stmt, sql.data, - parent, rootid); + parent, rootid); pfree(sql.data); @@ -3802,7 +3822,7 @@ Datum hypopg_drop_table(PG_FUNCTION_ARGS) { #if PG_VERSION_NUM < 100000 -HYPO_PARTITION_NOT_SUPPORTED(); + HYPO_PARTITION_NOT_SUPPORTED(); #else Oid tableid = PG_GETARG_OID(0); @@ -3811,7 +3831,7 @@ HYPO_PARTITION_NOT_SUPPORTED(); if (!hypo_table_oid_is_hypothetical(tableid)) elog(ERROR, "hypopg: Oid %d is not a hypothetically partitioned table", - tableid); + tableid); PG_RETURN_BOOL(hypo_table_remove(tableid, NULL, true)); #endif @@ -3824,21 +3844,21 @@ Datum hypopg_partition_table(PG_FUNCTION_ARGS) { #if PG_VERSION_NUM < 100000 -HYPO_PARTITION_NOT_SUPPORTED(); + HYPO_PARTITION_NOT_SUPPORTED(); #else - Oid tableid = PG_GETARG_OID(0); - char *partition_by = TextDatumGetCString(PG_GETARG_TEXT_PP(1)); - hypoTable *entry; - hypoTable *root; - char *root_name = NULL; - char *nspname = NULL; - bool found = false; - HeapTuple tp; - Relation relation; - List *children = NIL; - List *parsetree_list; - StringInfoData sql; - RawStmt *raw_stmt; + Oid tableid = PG_GETARG_OID(0); + char *partition_by = TextDatumGetCString(PG_GETARG_TEXT_PP(1)); + hypoTable *entry; + hypoTable *root; + char *root_name = NULL; + char *nspname = NULL; + bool found = false; + HeapTuple tp; + Relation relation; + List *children = NIL; + List *parsetree_list; + StringInfoData sql; + RawStmt *raw_stmt; /* Process any pending invalidation */ hypo_process_inval(); @@ -3861,7 +3881,7 @@ HYPO_PARTITION_NOT_SUPPORTED(); if (!found) elog(ERROR, "hypopg: %s.%s is not a simple table", - quote_identifier(nspname), quote_identifier(root_name)); + quote_identifier(nspname), quote_identifier(root_name)); relation = heap_open(tableid, AccessShareLock); @@ -3870,25 +3890,25 @@ HYPO_PARTITION_NOT_SUPPORTED(); if (children != NIL) elog(ERROR, "hypopg: Table %s.%s has inherited tables", - quote_identifier(nspname), quote_identifier(root_name)); + quote_identifier(nspname), quote_identifier(root_name)); root = hypo_find_table(tableid, true); if (root) { elog(ERROR, "hypopg: Table %s.%s is already hypothetically partitioned", - quote_identifier(nspname), quote_identifier(root_name)); + quote_identifier(nspname), quote_identifier(root_name)); } initStringInfo(&sql); appendStringInfo(&sql, "CREATE TABLE hypoTable (LIKE %s.%s) %s", - quote_identifier(nspname), quote_identifier(root_name), partition_by); + quote_identifier(nspname), quote_identifier(root_name), partition_by); parsetree_list = pg_parse_query(sql.data); raw_stmt = (RawStmt *) linitial(parsetree_list); Assert(IsA(raw_stmt->stmt, CreateStmt)); entry = hypo_table_store_parsetree((CreateStmt *) raw_stmt->stmt, sql.data, - NULL, tableid); + NULL, tableid); /* special case for root table, copy it's original name */ strncpy(entry->tablename, root_name, NAMEDATALEN); @@ -3908,7 +3928,7 @@ Datum hypopg_reset_table(PG_FUNCTION_ARGS) { #if PG_VERSION_NUM < 100000 -HYPO_PARTITION_NOT_SUPPORTED(); + HYPO_PARTITION_NOT_SUPPORTED(); #else /* Process any pending invalidation */ hypo_process_inval(); @@ -3925,15 +3945,15 @@ Datum hypopg_table(PG_FUNCTION_ARGS) { #if PG_VERSION_NUM < 100000 -HYPO_PARTITION_NOT_SUPPORTED(); + HYPO_PARTITION_NOT_SUPPORTED(); #else ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; MemoryContext per_query_ctx; MemoryContext oldcontext; TupleDesc tupdesc; Tuplestorestate *tupstore; - HASH_SEQ_STATUS hash_seq; - hypoTable *entry; + HASH_SEQ_STATUS hash_seq; + hypoTable *entry; /* Process any pending invalidation */ hypo_process_inval(); diff --git a/include/hypopg.h b/include/hypopg.h index 3635b7a..fc2a3cd 100644 --- a/include/hypopg.h +++ b/include/hypopg.h @@ -20,12 +20,13 @@ #include "include/hypopg_import.h" extern bool isExplain; + /* GUC for enabling / disabling hypopg during EXPLAIN */ extern bool hypo_is_enabled; extern MemoryContext HypoMemoryContext; -Oid hypo_getNewOid(Oid relid); -void hypo_process_inval(void); -void hypo_clear_inval(void); +Oid hypo_getNewOid(Oid relid); +void hypo_process_inval(void); +void hypo_clear_inval(void); #endif diff --git a/include/hypopg_analyze.h b/include/hypopg_analyze.h index 072b2fe..6682f0b 100644 --- a/include/hypopg_analyze.h +++ b/include/hypopg_analyze.h @@ -23,30 +23,30 @@ typedef struct hypoStatsKey { - Oid relid; - AttrNumber attnum; + Oid relid; + AttrNumber attnum; } hypoStatsKey; typedef struct hypoStatsEntry { hypoStatsKey key; - HeapTuple statsTuple; + HeapTuple statsTuple; } hypoStatsEntry; /*--- Variables exported ---*/ /* Hash table storing the partition-level statistics */ extern HTAB *hypoStatsHash; -#endif /* PG_VERSION_NUM >= 100000 */ +#endif /* PG_VERSION_NUM >= 100000 */ Selectivity hypo_clauselist_selectivity(PlannerInfo *root, RelOptInfo *rel, - List *clauses, Oid table_relid, Oid parent_oid); + List *clauses, Oid table_relid, Oid parent_oid); /*--- Functions --- */ -PGDLLEXPORT Datum hypopg_analyze(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_statistic(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_analyze(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_statistic(PG_FUNCTION_ARGS); #if PG_VERSION_NUM >= 100000 PGDLLEXPORT void hypo_stat_remove(Oid tableid); #endif -#endif /* _HYPOPG_ANALYZE_H_ */ +#endif /* _HYPOPG_ANALYZE_H_ */ diff --git a/include/hypopg_index.h b/include/hypopg_index.h index 3738533..06dbdd5 100644 --- a/include/hypopg_index.h +++ b/include/hypopg_index.h @@ -22,7 +22,8 @@ #include "tcop/utility.h" #define HYPO_INDEX_NB_COLS 12 /* # of column hypopg() returns */ -#define HYPO_INDEX_CREATE_COLS 2 /* # of column hypopg_create_index() returns */ +#define HYPO_INDEX_CREATE_COLS 2 /* # of column hypopg_create_index() + * returns */ #if PG_VERSION_NUM >= 90600 /* hardcode some bloom values, bloom.h is not exported */ @@ -95,8 +96,8 @@ typedef struct hypoIndex #if PG_VERSION_NUM >= 110000 bool amcanparallel; /* does AM support parallel scan? */ #endif - bool amcanunique; /* does AM support UNIQUE indexes? */ - bool amcanmulticol; /* does AM support multi-column indexes? */ + bool amcanunique; /* does AM support UNIQUE indexes? */ + bool amcanmulticol; /* does AM support multi-column indexes? */ /* store some informations usually saved in catalogs */ List *options; /* WITH clause options: a list of DefElem */ @@ -105,18 +106,18 @@ typedef struct hypoIndex } hypoIndex; /* List of hypothetic indexes for current backend */ -extern List *hypoIndexes; +extern List *hypoIndexes; /*--- Functions --- */ -void hypo_index_reset(void); +void hypo_index_reset(void); -PGDLLEXPORT Datum hypopg(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_create_index(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_drop_index(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_relation_size(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_get_indexdef(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_reset_index(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_create_index(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_drop_index(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_relation_size(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_get_indexdef(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_reset_index(PG_FUNCTION_ARGS); extern explain_get_index_name_hook_type prev_explain_get_index_name_hook; const char *hypo_explain_get_index_name_hook(Oid indexId); diff --git a/include/hypopg_table.h b/include/hypopg_table.h index d9dcd58..ffcdbe2 100644 --- a/include/hypopg_table.h +++ b/include/hypopg_table.h @@ -47,54 +47,55 @@ typedef struct hypoTable { Oid oid; /* hypothetical table unique identifier */ Oid parentid; /* In case of partition, it's direct parent, - otherwise InvalidOid */ + * otherwise InvalidOid */ Oid rootid; /* In case of partition, its root parentid, - otherwise its own oid */ - char tablename[NAMEDATALEN]; /* hypothetical partition name, or - original table name for root parititon */ + * otherwise its own oid */ + char tablename[NAMEDATALEN]; /* hypothetical partition name, or + * original table name for root + * parititon */ Oid namespace; /* Oid of the hypothetical table's schema */ bool set_tuples; /* tuples are already set or not */ - int tuples; /* number of tuples of this table */ + int tuples; /* number of tuples of this table */ List *children; /* unsorted OIDs of children, if any */ - PartitionBoundSpec *boundspec; /* Needed to generate the PartitionDesc and - PartitionBoundInfo */ - PartitionKey partkey; /* Needed to generate the partition key - expressions and deparsing */ - Oid *partopclass; /* oid of partkey's element opclass, needed for - deparsing the key */ + PartitionBoundSpec *boundspec; /* Needed to generate the PartitionDesc + * and PartitionBoundInfo */ + PartitionKey partkey; /* Needed to generate the partition key + * expressions and deparsing */ + Oid *partopclass; /* oid of partkey's element opclass, needed + * for deparsing the key */ bool valid; } hypoTable; /* List of hypothetic partitions for current backend */ -extern HTAB *hypoTables; +extern HTAB *hypoTables; #else #define HYPO_PARTITION_NOT_SUPPORTED() elog(ERROR, "hypopg: Hypothetical partitioning requires PostgreSQl 10 or above"); PG_RETURN_VOID(); #endif /*--- Functions --- */ -void hypo_table_reset(void); +void hypo_table_reset(void); -PGDLLEXPORT Datum hypopg_table(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_add_partition(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_drop_table(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_partition_table(PG_FUNCTION_ARGS); -PGDLLEXPORT Datum hypopg_reset_table(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_table(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_add_partition(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_drop_table(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_partition_table(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum hypopg_reset_table(PG_FUNCTION_ARGS); #if PG_VERSION_NUM >= 100000 -hypoTable *hypo_find_table(Oid tableid, bool missing_ok); +hypoTable *hypo_find_table(Oid tableid, bool missing_ok); List *hypo_get_partition_constraints(PlannerInfo *root, RelOptInfo *rel, - hypoTable *parent, bool force_generation); -List *hypo_get_partition_quals_inh(hypoTable *part, hypoTable *parent); -hypoTable *hypo_table_name_get_entry(const char *name); -bool hypo_table_oid_is_hypothetical(Oid relid); -bool hypo_table_remove(Oid tableid, hypoTable *parent, bool deep); + hypoTable *parent, bool force_generation); +List *hypo_get_partition_quals_inh(hypoTable *part, hypoTable *parent); +hypoTable *hypo_table_name_get_entry(const char *name); +bool hypo_table_oid_is_hypothetical(Oid relid); +bool hypo_table_remove(Oid tableid, hypoTable *parent, bool deep); void hypo_injectHypotheticalPartitioning(PlannerInfo *root, - Oid relationObjectId, - RelOptInfo *rel); + Oid relationObjectId, + RelOptInfo *rel); #if PG_VERSION_NUM < 110000 void hypo_markDummyIfExcluded(PlannerInfo *root, RelOptInfo *rel, - Index rti, RangeTblEntry *rte); + Index rti, RangeTblEntry *rte); #endif #endif diff --git a/typedefs.list b/typedefs.list index 625e860..71906d4 100644 --- a/typedefs.list +++ b/typedefs.list @@ -1,4 +1,8 @@ -hypoEntry +hypoIndex +hypoStatsEntry +hypoStatsKey +hypoTable +hypoWalkerContext ABITVEC ACCESS_ALLOWED_ACE ACL @@ -6,6 +10,7 @@ ACL_SIZE_INFORMATION AES_KEY AFFIX ASN1_INTEGER +ASN1_OBJECT ASN1_STRING AV A_ArrayExpr @@ -16,6 +21,7 @@ A_Indices A_Indirection A_Star AbsoluteTime +AccessMethodInfo AccessPriv Acl AclItem @@ -34,16 +40,24 @@ AfterTriggerEventData AfterTriggerEventList AfterTriggerShared AfterTriggerSharedData +AfterTriggers AfterTriggersData +AfterTriggersQueryData +AfterTriggersTableData +AfterTriggersTransData Agg AggClauseCosts AggHashEntry AggInfo +AggPath +AggSplit AggState AggStatePerAgg AggStatePerGroup AggStatePerGroupData +AggStatePerHash AggStatePerPhase +AggStatePerTrans AggStrategy AggVals Aggref @@ -55,8 +69,10 @@ AllocChunk AllocPointer AllocSet AllocSetContext +AllocSetFreeList AllocateDesc AllocateDescKind +AlterCollationStmt AlterDatabaseSetStmt AlterDatabaseStmt AlterDefaultPrivilegesStmt @@ -68,13 +84,18 @@ AlterExtensionStmt AlterFdwStmt AlterForeignServerStmt AlterFunctionStmt +AlterObjectDependsStmt AlterObjectSchemaStmt AlterOpFamilyStmt +AlterOperatorStmt AlterOwnerStmt AlterPolicyStmt +AlterPublicationStmt AlterRoleSetStmt AlterRoleStmt AlterSeqStmt +AlterSubscriptionStmt +AlterSubscriptionType AlterSystemStmt AlterTSConfigType AlterTSConfigurationStmt @@ -99,6 +120,7 @@ AppendRelInfo AppendState Archive ArchiveEntryPtr +ArchiveEntryPtrType ArchiveFormat ArchiveHandle ArchiveMode @@ -114,25 +136,33 @@ ArrayConstIterState ArrayExpr ArrayExprIterState ArrayExprState +ArrayIOData ArrayIterator ArrayMapState ArrayMetaState ArrayParseState ArrayRef ArrayRefExprState +ArrayRefState +ArrayRemapInfo ArrayType AsyncQueueControl AsyncQueueEntry AttInMetadata +AttStatsSlot AttoptCacheEntry AttoptCacheKey AttrDefInfo AttrDefault +AttrMissing AttrNumber AttributeOpts AuthRequest +AutoPrewarmSharedState AutoVacOpts AutoVacuumShmemStruct +AutoVacuumWorkItem +AutoVacuumWorkItemType AuxProcType BF_KEY BF_ctx @@ -154,17 +184,21 @@ BTArrayKeyInfo BTBuildState BTCycleId BTIndexStat +BTLeader BTMetaPageData BTOneVacInfo +BTPS_State BTPageOpaque BTPageOpaqueData BTPageStat BTPageState +BTParallelScanDesc BTScanOpaque BTScanOpaqueData BTScanPos BTScanPosData BTScanPosItem +BTShared BTSortArrayContext BTSpool BTStack @@ -177,13 +211,18 @@ Backend BackendId BackendParameters BackendState +BackendType BackgroundWorker BackgroundWorkerArray BackgroundWorkerHandle BackgroundWorkerSlot +Barrier BaseBackupCmd +BeginDirectModify_function +BeginForeignInsert_function BeginForeignModify_function BeginForeignScan_function +BeginSampleScan_function BernoulliSamplerData BgWorkerStartTime BgwHandleStatus @@ -200,13 +239,27 @@ BitmapOr BitmapOrPath BitmapOrState Bitmapset +BkpBlock BlobInfo Block BlockId BlockIdData +BlockInfoRecord BlockNumber BlockSampler BlockSamplerData +BlockedProcData +BlockedProcsData +BloomBuildState +BloomMetaPageData +BloomOptions +BloomPageOpaque +BloomPageOpaqueData +BloomScanOpaque +BloomScanOpaqueData +BloomSignatureWord +BloomState +BloomTuple BlowfishContext BoolAggState BoolExpr @@ -224,8 +277,11 @@ BrinOpcInfo BrinOptions BrinRevmap BrinSpecialSpace +BrinStatsData BrinTuple BrinValues +BtreeCheckState +BtreeLevel Bucket BufFile BufFlags @@ -236,15 +292,20 @@ BufferCachePagesContext BufferCachePagesRec BufferDesc BufferDescPadded +BufferHeapTupleTableSlot BufferLookupEnt BufferStrategyControl BufferTag BufferUsage BuildAccumulator +BuiltinScript BulkInsertState +BulkInsertStateData CACHESIGN CAC_state CAST_KEY +CCFastEqualFN +CCHashFN CEOUC_WAIT_MODE CFuncHashTabEntry CHAR @@ -255,11 +316,15 @@ CMPDAffix CONTEXT COP CRITICAL_SECTION +CRSSnapshotAction CState CV C_block +CachedExpression CachedPlan CachedPlanSource +CallContext +CallStmt CancelRequestPacket CaseExpr CaseExprState @@ -282,11 +347,16 @@ CheckpointerRequest CheckpointerShmemStruct Chromosome City +CkptSortItem +CkptTsStatus ClientAuthentication_hook_type ClientData ClonePtr +ClonePtrType +ClonedConstraint ClosePortalStmt ClosePtr +ClosePtrType Clump ClusterInfo ClusterStmt @@ -302,6 +372,7 @@ CoerceViaIOState CoercionContext CoercionForm CoercionPathType +CollAliasData CollInfo CollateClause CollateExpr @@ -315,6 +386,8 @@ ColumnCompareData ColumnDef ColumnIOData ColumnRef +ColumnsHashData +CombinationGenerator ComboCidEntry ComboCidEntryData ComboCidKey @@ -329,15 +402,21 @@ CommitTimestampShared CommonEntry CommonTableExpr CompareScalarsContext +CompiledExprState +CompositeIOData CompositeTypeStmt +CompoundAffixFlag CompressionAlgorithm CompressorState -ConfigFileVariable +ConditionVariable +ConditionalStack +ConfigData ConfigVariable ConnCacheEntry ConnCacheKey ConnStatusType ConnType +ConnectionStateEnum ConsiderSplitContext Const ConstrCheck @@ -355,6 +434,7 @@ ConvertRowtypeExpr ConvertRowtypeExprState CookedConstraint CopyDest +CopyInsertMethod CopyState CopyStateData CopyStmt @@ -363,6 +443,7 @@ CostSelector Counters CoverExt CoverPos +CreateAmStmt CreateCastStmt CreateConversionStmt CreateDomainStmt @@ -378,14 +459,17 @@ CreateOpClassStmt CreateOpFamilyStmt CreatePLangStmt CreatePolicyStmt +CreatePublicationStmt CreateRangeStmt CreateReplicationSlotCmd CreateRoleStmt CreateSchemaStmt CreateSchemaStmtContext CreateSeqStmt +CreateStatsStmt CreateStmt CreateStmtContext +CreateSubscriptionStmt CreateTableAsStmt CreateTableSpaceStmt CreateTransformStmt @@ -402,6 +486,7 @@ CtxtHandle CurrentOfExpr CustomExecMethods CustomOutPtr +CustomOutPtrType CustomPath CustomPathMethods CustomScan @@ -409,7 +494,6 @@ CustomScanMethods CustomScanState CycleCtr DBState -DBWriteRequest DCHCacheEntry DEADLOCK_INFO DECountItem @@ -424,6 +508,7 @@ DR_intorel DR_printtup DR_sqlfunction DR_transientrel +DSA DWORD DataDumperPtr DataPageDeleteStack @@ -433,6 +518,7 @@ DatumTupleFields DbInfo DbInfoArr DeClonePtr +DeClonePtrType DeadLockState DeallocateStmt DeclareCursorStmt @@ -443,6 +529,8 @@ DefElemAction DefaultACLInfo DefineStmt DeleteStmt +DependencyGenerator +DependencyGeneratorData DependencyType DestReceiver DictISpell @@ -452,6 +540,8 @@ DictSnowball DictSubState DictSyn DictThesaurus +DirectoryMethodData +DirectoryMethodFile DisableTimeoutParams DiscardMode DiscardStmt @@ -468,11 +558,14 @@ DropOwnedStmt DropReplicationSlotCmd DropRoleStmt DropStmt +DropSubscriptionStmt DropTableSpaceStmt DropUserMappingStmt DropdbStmt +DumpComponents DumpId DumpOptions +DumpSignalInformation DumpableObject DumpableObjectType DynamicFileList @@ -485,24 +578,39 @@ EOM_get_flat_size_method EPQState EPlan EState +EVP_CIPHER +EVP_CIPHER_CTX EVP_MD EVP_MD_CTX EVP_PKEY EachState Edge +EditableObjectType ElementsState EnableTimeoutParams EndBlobPtr +EndBlobPtrType EndBlobsPtr +EndBlobsPtrType EndDataPtr +EndDataPtrType +EndDirectModify_function +EndForeignInsert_function EndForeignModify_function EndForeignScan_function +EndSampleScan_function EnumItem EolType +EphemeralNameRelationType +EphemeralNamedRelation +EphemeralNamedRelationData +EphemeralNamedRelationMetadata +EphemeralNamedRelationMetadataData EquivalenceClass EquivalenceMember ErrorContextCallback ErrorData +EstimateDSMForeignScan_function EventTriggerCacheEntry EventTriggerCacheItem EventTriggerCacheStateType @@ -512,10 +620,16 @@ EventTriggerInfo EventTriggerQueryState ExceptionLabelMap ExceptionMap +ExclusiveBackupState ExecAuxRowMark +ExecEvalSubroutine ExecForeignDelete_function ExecForeignInsert_function ExecForeignUpdate_function +ExecParallelEstimateContext +ExecParallelInitializeDSMContext +ExecPhraseData +ExecProcNodeMtd ExecRowMark ExecScanAccessMtd ExecScanRecheckMtd @@ -530,22 +644,34 @@ ExecutorStart_hook_type ExpandedArrayHeader ExpandedObjectHeader ExpandedObjectMethods +ExpandedRecordFieldInfo +ExpandedRecordHeader +ExplainDirectModify_function ExplainForeignModify_function ExplainForeignScan_function ExplainFormat ExplainOneQuery_hook_type ExplainState +ExplainStateExtra ExplainStmt +ExportedSnapshot Expr ExprContext ExprContextCallbackFunction ExprContext_CB ExprDoneCond +ExprEvalOp +ExprEvalOpLookup +ExprEvalStep ExprState ExprStateEvalFunc +ExtensibleNode +ExtensibleNodeEntry +ExtensibleNodeMethods ExtensionBehavior ExtensionControlFile ExtensionInfo +ExtensionMemberId ExtensionVersionInfo FDWCollateState FD_SET @@ -573,12 +699,17 @@ FileFdwPlanState FileName FileNameMap FindSplitData +FixedParallelExecutorState FixedParallelState FixedParamState +FlagMode +FlushPosition FmgrBuiltin FmgrHookEventType FmgrInfo ForeignDataWrapper +ForeignKeyCacheInfo +ForeignKeyOptInfo ForeignPath ForeignScan ForeignScanState @@ -617,16 +748,22 @@ FormData_pg_namespace FormData_pg_opclass FormData_pg_operator FormData_pg_opfamily +FormData_pg_partitioned_table FormData_pg_pltemplate FormData_pg_policy FormData_pg_proc +FormData_pg_publication +FormData_pg_publication_rel FormData_pg_range FormData_pg_replication_origin FormData_pg_rewrite FormData_pg_sequence +FormData_pg_sequence_data FormData_pg_shdepend FormData_pg_statistic -FormData_pg_tablesample_method +FormData_pg_statistic_ext +FormData_pg_subscription +FormData_pg_subscription_rel FormData_pg_tablespace FormData_pg_transform FormData_pg_trigger @@ -668,16 +805,22 @@ Form_pg_namespace Form_pg_opclass Form_pg_operator Form_pg_opfamily +Form_pg_partitioned_table Form_pg_pltemplate Form_pg_policy Form_pg_proc +Form_pg_publication +Form_pg_publication_rel Form_pg_range Form_pg_replication_origin Form_pg_rewrite Form_pg_sequence +Form_pg_sequence_data Form_pg_shdepend Form_pg_statistic -Form_pg_tablesample_method +Form_pg_statistic_ext +Form_pg_subscription +Form_pg_subscription_rel Form_pg_tablespace Form_pg_transform Form_pg_trigger @@ -689,6 +832,15 @@ Form_pg_ts_template Form_pg_type Form_pg_user_mapping FormatNode +FreeBlockNumberArray +FreeListData +FreePageBtree +FreePageBtreeHeader +FreePageBtreeInternalKey +FreePageBtreeLeafKey +FreePageBtreeSearchResult +FreePageManager +FreePageSpanLeader FromCharDateMode FromExpr FuncCall @@ -699,6 +851,7 @@ FuncExpr FuncExprState FuncInfo FuncWithArgs +Function FunctionCallInfo FunctionCallInfoData FunctionParameter @@ -727,18 +880,34 @@ GISTScanOpaque GISTScanOpaqueData GISTSearchHeapItem GISTSearchItem +GISTSearchTreeItem GISTTYPE GIST_SPLITVEC +GMReaderTupleBuffer GV +Gather +GatherMerge +GatherMergePath +GatherMergeState +GatherPath +GatherState Gene +GeneratePruningStepsContext +GenerationBlock +GenerationChunk +GenerationContext +GenerationPointer GenericCosts GenericExprState +GenericIndexOpts +GenericXLogState GeqoPrivateData GetForeignJoinPaths_function GetForeignPaths_function GetForeignPlan_function GetForeignRelSize_function GetForeignRowMarkType_function +GetForeignUpperPaths_function GetState GiSTOptions GinBtree @@ -780,12 +949,16 @@ GrantRoleStmt GrantStmt GrantTargetType Group +GroupPath +GroupPathExtraData GroupState GroupVarInfo GroupingFunc GroupingFuncExprState GroupingSet +GroupingSetData GroupingSetKind +GroupingSetsPath GucAction GucBoolAssignHook GucBoolCheckHook @@ -831,6 +1004,8 @@ HashAllocFunc HashBuildState HashCompareFunc HashCopyFunc +HashIndexStat +HashInstrumentation HashJoin HashJoinState HashJoinTable @@ -840,16 +1015,20 @@ HashMetaPage HashMetaPageData HashPageOpaque HashPageOpaqueData +HashPageStat HashPath HashScanList HashScanListData HashScanOpaque HashScanOpaqueData +HashScanPosData +HashScanPosItem HashSkewBucket HashState HashValueFunc HbaLine HbaToken +HeadlineJsonState HeadlineParsedText HeadlineWordEntry HeapScanDesc @@ -858,11 +1037,15 @@ HeapTupleData HeapTupleFields HeapTupleHeader HeapTupleHeaderData +HeapTupleTableSlot HeapUpdateFailureData HistControl HotStandbyState I32 +ICU_Convert_Func +ID INFIX +INT128 INTERFACE_INFO IOFuncSelector IPCompareMethod @@ -871,14 +1054,19 @@ IV IdentLine IdentifierLookup IdentifySystemCmd +IfStackElem ImportForeignSchemaStmt ImportForeignSchemaType ImportForeignSchema_function ImportQual +IncludeWal InclusionOpaque IncrementVarSublevelsUp_context Index +IndexAMProperty +IndexAmRoutine IndexArrayKeyInfo +IndexAttachInfo IndexAttrBitmapKind IndexBuildCallback IndexBuildResult @@ -911,23 +1099,32 @@ InfoItem InhInfo InhOption InheritableSocket +InheritanceKind +InitSampleScan_function +InitializeDSMForeignScan_function +InitializeWorkerForeignScan_function InlineCodeBlock InsertStmt Instrumentation Int128AggState Int8TransTypeData IntArray +IntRBTreeNode +InternalBGWorkerMain InternalDefaultACL InternalGrant Interval +IntervalOffset IntoClause InvalidationChunk InvalidationListHeader +InvertedWalkNextStep IpcMemoryId IpcMemoryKey IpcSemaphoreId IpcSemaphoreKey IsForeignRelUpdatable_function +IsForeignScanParallelSafe_function IspellDict Item ItemId @@ -936,13 +1133,22 @@ ItemLength ItemOffset ItemPointer ItemPointerData +IterateDirectModify_function IterateForeignScan_function +IterateJsonStringValuesState JEntry JHashState JOBOBJECTINFOCLASS JOBOBJECT_BASIC_LIMIT_INFORMATION JOBOBJECT_BASIC_UI_RESTRICTIONS JOBOBJECT_SECURITY_LIMIT_INFORMATION +JitContext +JitInstrumentation +JitProviderCallbacks +JitProviderCompileExprCB +JitProviderInit +JitProviderReleaseContextCB +JitProviderResetAfterErrorCB Join JoinCostWorkspace JoinExpr @@ -951,13 +1157,19 @@ JoinPath JoinPathExtraData JoinState JoinType +JsObject +JsValue +JsonAggState JsonHashEntry +JsonIterateStringValuesAction JsonLexContext JsonParseContext JsonSemAction JsonTokenType +JsonTransformStringValuesAction JsonTypeCategory Jsonb +JsonbAggState JsonbContainer JsonbInState JsonbIterState @@ -977,6 +1189,24 @@ LDAPMessage LDAPURLDesc LDAP_TIMEVAL LINE +LLVMAttributeRef +LLVMBasicBlockRef +LLVMBuilderRef +LLVMIntPredicate +LLVMJitContext +LLVMJitHandle +LLVMMemoryBufferRef +LLVMModuleRef +LLVMOrcJITStackRef +LLVMOrcModuleHandle +LLVMOrcTargetAddress +LLVMPassManagerBuilderRef +LLVMPassManagerRef +LLVMSharedModuleRef +LLVMTargetMachineRef +LLVMTargetRef +LLVMTypeRef +LLVMValueRef LOCALLOCK LOCALLOCKOWNER LOCALLOCKTAG @@ -1001,14 +1231,18 @@ LPTSTR LPVOID LPWSTR LSEG +LUID LVRelStats LWLock LWLockHandle +LWLockMinimallyPadded LWLockMode LWLockPadded LWLockTranche LabelProvider +LagTracker LargeObjectDesc +LastAttnumInfo Latch LateralJoinInfo LerpFunc @@ -1018,7 +1252,9 @@ LexemeHashKey LexemeInfo LexemeKey LexizeData +LibraryInfo Limit +LimitPath LimitState LimitStateCond List @@ -1042,10 +1278,12 @@ LockMethod LockMethodData LockRelId LockRows +LockRowsPath LockRowsState LockStmt LockTagType LockTupleMode +LockViewRecurse_context LockWaitPolicy LockingClause LogOpts @@ -1054,13 +1292,26 @@ LogicalDecodeBeginCB LogicalDecodeChangeCB LogicalDecodeCommitCB LogicalDecodeFilterByOriginCB +LogicalDecodeMessageCB LogicalDecodeShutdownCB LogicalDecodeStartupCB +LogicalDecodeTruncateCB LogicalDecodingContext LogicalErrorCallbackState LogicalOutputPluginInit LogicalOutputPluginWriterPrepareWrite +LogicalOutputPluginWriterUpdateProgress LogicalOutputPluginWriterWrite +LogicalRepBeginData +LogicalRepCommitData +LogicalRepCtxStruct +LogicalRepRelId +LogicalRepRelMapEntry +LogicalRepRelation +LogicalRepTupleData +LogicalRepTyp +LogicalRepWorker +LogicalRepWorkerId LogicalRewriteMappingData LogicalTape LogicalTapeSet @@ -1070,6 +1321,10 @@ MEMORY_BASIC_INFORMATION MINIDUMPWRITEDUMP MINIDUMP_TYPE MJEvalResult +MVDependencies +MVDependency +MVNDistinct +MVNDistinctItem MasterEndParallelItemPtr MasterStartParallelItemPtr Material @@ -1080,8 +1335,10 @@ MembersLiveRange MemoryContext MemoryContextCallback MemoryContextCallbackFunction +MemoryContextCounters MemoryContextData MemoryContextMethods +MemoryStatsPrintFunc MergeAppend MergeAppendPath MergeAppendState @@ -1090,17 +1347,25 @@ MergeJoinClause MergeJoinState MergePath MergeScanSelCache +MetaCommand MinMaxAggInfo +MinMaxAggPath MinMaxExpr MinMaxExprState MinMaxOp MinimalTuple MinimalTupleData +MinimalTupleTableSlot MinmaxOpaque +MissingPtr ModifyTable +ModifyTablePath ModifyTableState +MorphOpaque MsgType MultiAssignRef +MultiSortSupport +MultiSortSupportData MultiXactId MultiXactMember MultiXactOffset @@ -1115,7 +1380,12 @@ NUMProc NV Name NameData +NameHashEntry NamedArgExpr +NamedLWLockTranche +NamedLWLockTrancheRequest +NamedTuplestoreScan +NamedTuplestoreScanState NamespaceInfo NestLoop NestLoopParam @@ -1123,6 +1393,10 @@ NestLoopState NestPath NewColumnValue NewConstraint +NewPage +NextSampleBlock_function +NextSampleTuple_function +NextValueExpr Node NodeTag NonEmptyRange @@ -1137,12 +1411,14 @@ Numeric NumericAggState NumericDigit NumericSortSupport +NumericSumAccum NumericVar OM_uint32 OP OSAPerGroupState OSAPerQueryState OSInfo +OSSLCipher OSSLDigest OSVERSIONINFO OVERLAPPED @@ -1158,6 +1434,7 @@ ObjectAddresses ObjectClass ObjectPropertyType ObjectType +ObjectWithArgs Offset OffsetNumber OffsetVarNodes_context @@ -1165,6 +1442,7 @@ Oid OidOptions OkeysState OldSerXidControl +OldSnapshotControlData OldToNewMapping OldToNewMappingData OldTriggerInfo @@ -1174,12 +1452,15 @@ OnCommitItem OnConflictAction OnConflictClause OnConflictExpr +OnConflictSetState OpBtreeInterpretation OpClassCacheEnt OpExpr OpFamilyMember +OpFamilyOpFuncGroup OpclassInfo Operator +OperatorElement OpfamilyInfo OprCacheEntry OprCacheKey @@ -1192,14 +1473,19 @@ OutputPluginOptions OutputPluginOutputType OverrideSearchPath OverrideStackEntry +OverridingKind PACE_HEADER PACL PATH PBOOL PCtxtHandle PFN +PGAlignedBlock +PGAlignedXLogBlock PGAsyncStatusType PGCALL2 +PGChecksummablePage +PGContextVisibility PGEvent PGEventConnDestroy PGEventConnReset @@ -1211,11 +1497,13 @@ PGEventResultCreate PGEventResultDestroy PGFInfoFunction PGFunction +PGLZ_Header PGLZ_HistEntry PGLZ_Strategy PGMessageField PGModuleMagicFunction PGNoticeHooks +PGOutputData PGPROC PGP_CFB PGP_Context @@ -1254,6 +1542,7 @@ PLpgSQL_arrayelem PLpgSQL_case_when PLpgSQL_condition PLpgSQL_datum +PLpgSQL_datum_type PLpgSQL_diag_item PLpgSQL_exception PLpgSQL_exception_block @@ -1261,10 +1550,15 @@ PLpgSQL_execstate PLpgSQL_expr PLpgSQL_func_hashkey PLpgSQL_function +PLpgSQL_getdiag_kind PLpgSQL_if_elsif +PLpgSQL_label_type PLpgSQL_nsitem +PLpgSQL_nsitem_type PLpgSQL_plugin +PLpgSQL_promise_type PLpgSQL_raise_option +PLpgSQL_raise_option_type PLpgSQL_rec PLpgSQL_recfield PLpgSQL_resolve_option @@ -1273,8 +1567,10 @@ PLpgSQL_stmt PLpgSQL_stmt_assert PLpgSQL_stmt_assign PLpgSQL_stmt_block +PLpgSQL_stmt_call PLpgSQL_stmt_case PLpgSQL_stmt_close +PLpgSQL_stmt_commit PLpgSQL_stmt_dynexecute PLpgSQL_stmt_dynfors PLpgSQL_stmt_execsql @@ -1294,32 +1590,48 @@ PLpgSQL_stmt_raise PLpgSQL_stmt_return PLpgSQL_stmt_return_next PLpgSQL_stmt_return_query +PLpgSQL_stmt_rollback +PLpgSQL_stmt_set +PLpgSQL_stmt_type PLpgSQL_stmt_while PLpgSQL_trigtype PLpgSQL_type +PLpgSQL_type_type PLpgSQL_var PLpgSQL_variable PLwdatum PLword +PLyArrayToOb PLyCursorObject PLyDatumToOb PLyDatumToObFunc PLyExceptionEntry PLyExecutionContext +PLyObToArray PLyObToDatum PLyObToDatumFunc +PLyObToDomain +PLyObToScalar +PLyObToTransform PLyObToTuple +PLyObject_AsString_t PLyPlanObject PLyProcedure PLyProcedureEntry PLyProcedureKey PLyResultObject +PLySRFState +PLySavedArgs +PLyScalarToOb PLySubtransactionData PLySubtransactionObject +PLyTransformToOb PLyTupleToOb PLyTypeInfo PLyTypeInput PLyTypeOutput +PLyUnicode_FromStringAndSize_t +PLy_elog_impl_t PMINIDUMP_CALLBACK_INFORMATION PMINIDUMP_EXCEPTION_INFORMATION PMINIDUMP_USER_STREAM_INFORMATION @@ -1351,8 +1663,13 @@ PSQL_COMP_CASE PSQL_ECHO PSQL_ECHO_HIDDEN PSQL_ERROR_ROLLBACK +PTEntryArray +PTIterationArray PTOKEN_GROUPS +PTOKEN_PRIVILEGES PTOKEN_USER +PULONG +PUTENVPROC PVCAggregateBehavior PVCPlaceHolderBehavior PVOID @@ -1362,18 +1679,34 @@ PX_Combo PX_HMAC PX_MD Page +PageData PageGistNSN PageHeader PageHeaderData +PageSplitRecord PageXLogRecPtr PagetableEntry Pairs +ParallelAppendState ParallelArgs +ParallelBitmapHeapState +ParallelCompletionPtr ParallelContext +ParallelExecutorInfo +ParallelHashGrowth +ParallelHashJoinBatch +ParallelHashJoinBatchAccessor +ParallelHashJoinState +ParallelHeapScanDesc +ParallelHeapScanDescData +ParallelIndexScanDesc +ParallelReadyList ParallelSlot ParallelState +ParallelWorkerContext ParallelWorkerInfo Param +ParamCompileHook ParamExecData ParamExternData ParamFetchHook @@ -1388,29 +1721,73 @@ ParseNamespaceItem ParseParamRefHook ParseState ParsedLex +ParsedScript ParsedText ParsedWord ParserSetupHook ParserState +PartClauseInfo +PartClauseMatchStatus +PartitionBoundInfo +PartitionBoundInfoData +PartitionBoundSpec +PartitionCmd +PartitionDesc +PartitionDescData +PartitionDispatch +PartitionDispatchData +PartitionElem +PartitionHashBound +PartitionKey +PartitionListValue +PartitionPruneCombineOp +PartitionPruneContext +PartitionPruneInfo +PartitionPruneState +PartitionPruneStep +PartitionPruneStepCombine +PartitionPruneStepOp +PartitionPruningData +PartitionRangeBound +PartitionRangeDatum +PartitionRangeDatumKind +PartitionRoutingInfo +PartitionScheme +PartitionSpec +PartitionTupleRouting +PartitionedChildRelInfo +PartitionedRelPruneInfo +PartitionedRelPruningData +PartitionwiseAggregateType +PasswordType Path PathClauseUsage PathCostComparison PathHashStack PathKey PathKeysComparison +PathTarget Pattern_Prefix_Status Pattern_Type PendingOperationEntry PendingRelDelete PendingUnlinkEntry +PendingWriteback PerlInterpreter +Perl_check_t Perl_ppaddr_t Permutation PgBackendSSLStatus PgBackendStatus PgBenchExpr +PgBenchExprLink +PgBenchExprList PgBenchExprType +PgBenchFunction +PgBenchValue +PgBenchValueType PgFdwAnalyzeState +PgFdwDirectModifyState PgFdwModifyState PgFdwOption PgFdwRelationInfo @@ -1462,6 +1839,7 @@ PipeProtoHeader PlaceHolderInfo PlaceHolderVar Plan +PlanDirectModify_function PlanForeignModify_function PlanInvalItem PlanRowMark @@ -1475,6 +1853,10 @@ Pointer PolicyInfo PolyNumAggState Pool +PopulateArrayContext +PopulateArrayState +PopulateRecordCache +PopulateRecordsetCache PopulateRecordsetState Port Portal @@ -1493,16 +1875,20 @@ PredXactList PredXactListElement PredicateLockData PredicateLockTargetType +PrepParallelRestorePtrType PrepareStmt PreparedParamsData PreparedStatement PrewarmType PrintExtraTocPtr +PrintExtraTocPtrType PrintTocDataPtr +PrintTocDataPtrType PrintfArgType PrintfArgValue PrintfTarget PrinttupAttrInfo +PrivGrantee PrivTarget PrivateRefCountEntry ProcArrayStruct @@ -1513,22 +1899,36 @@ ProcState ProcessUtilityContext ProcessUtility_hook_type ProcessingMode +ProgressCommandType +ProjectSet +ProjectSetPath +ProjectSetState ProjectionInfo +ProjectionPath ProtocolVersion PrsStorage PruneState +PruneStepResult +PsqlScanCallbacks +PsqlScanQuoteType PsqlScanResult PsqlScanState PsqlScanStateData PsqlSettings +Publication +PublicationActions +PublicationInfo +PublicationRelInfo PullFilter PullFilterOps PushFilter PushFilterOps PushFunction +PyCFunction PyCodeObject PyMappingMethods PyMethodDef +PyModuleDef PyObject PySequenceMethods PyTypeObject @@ -1537,10 +1937,12 @@ QPRS_STATE QTN2QTState QTNode QUERYTYPE +QUERY_SECURITY_CONTEXT_TOKEN_FN QualCost QualItem Query QueryDesc +QueryEnvironment QueryInfo QueryItem QueryItemType @@ -1548,12 +1950,16 @@ QueryMode QueryOperand QueryOperator QueryRepresentation +QueryRepresentationOperand QuerySource QueueBackendStatus QueuePosition RBNode RBOrderControl +RBTNode +RBTOrderControl RBTree +RBTreeIterator REPARSE_JUNCTION_DATA_BUFFER RIX RI_CompareHashEntry @@ -1565,11 +1971,17 @@ RSA RTEKind RWConflict RWConflictPoolHeader +RandomState +Range RangeBound +RangeBox RangeFunction RangeIOData RangeQueryClause +RangeRemapInfo RangeSubselect +RangeTableFunc +RangeTableFuncCol RangeTableSample RangeTblEntry RangeTblFunction @@ -1578,20 +1990,32 @@ RangeType RangeVar RangeVarGetRelidCallback RawColumnDefault +RawStmt +ReInitializeDSMForeignScan_function ReScanForeignScan_function ReadBufPtr +ReadBufPtrType ReadBufferMode ReadBytePtr +ReadBytePtrType ReadExtraTocPtr +ReadExtraTocPtrType ReadFunc ReassignOwnedStmt +RecheckForeignScan_function RecordCacheEntry RecordCompareData RecordIOData +RecordRemapInfo +RecordTypmodMap +RecoveryLockListsEntry RecoveryTargetAction +RecoveryTargetTimeLineGoal RecoveryTargetType +RectBox RecursionContext RecursiveUnion +RecursiveUnionPath RecursiveUnionState RefetchForeignRow_function RefreshMatViewStmt @@ -1617,22 +2041,29 @@ Relation RelationAmInfo RelationData RelationPtr +RelationSyncEntry RelativeTime RelcacheCallbackFunction RelfilenodeMapEntry RelfilenodeMapKey Relids RelocationBufferInfo +RelptrFreePageBtree +RelptrFreePageManager +RelptrFreePageSpanLeader RenameStmt ReopenPtr +ReopenPtrType ReorderBuffer ReorderBufferApplyChangeCB +ReorderBufferApplyTruncateCB ReorderBufferBeginCB ReorderBufferChange ReorderBufferCommitCB ReorderBufferDiskChange ReorderBufferIterTXNEntry ReorderBufferIterTXNState +ReorderBufferMessageCB ReorderBufferTXN ReorderBufferTXNByIdEnt ReorderBufferToastEnt @@ -1641,6 +2072,7 @@ ReorderBufferTupleCidEnt ReorderBufferTupleCidKey ReorderTuple RepOriginId +ReparameterizeForeignPathByChild_function ReplaceVarsFromTargetList_context ReplaceVarsNoMatchOption ReplicaIdentityStmt @@ -1656,11 +2088,13 @@ ReplicationStateOnDisk ResTarget ReservoirState ReservoirStateData +ResourceArray ResourceOwner ResourceReleaseCallback ResourceReleaseCallbackItem ResourceReleasePhase RestoreOptions +RestorePass RestrictInfo Result ResultPath @@ -1679,6 +2113,7 @@ RmgrIds RoleSpec RoleSpecType RoleStmtType +RollupData RowCompareExpr RowCompareExprState RowCompareType @@ -1713,6 +2148,7 @@ SID_AND_ATTRIBUTES SID_IDENTIFIER_AUTHORITY SID_NAME_USE SISeg +SIZE_T SMgrRelation SMgrRelationData SOCKADDR @@ -1724,20 +2160,26 @@ SPLITCOST SPNode SPNodeData SPPageDesc +SQLCmd SQLDropObject SQLFunctionCache SQLFunctionCachePtr SQLFunctionParseInfoPtr +SQLValueFunction +SQLValueFunctionOp SSL +SSLExtensionInfoContext SSL_CTX STARTUPINFO STRLEN SV SampleScan +SampleScanGetSampleSize_function SampleScanState SamplerRandomState ScalarArrayOpExpr ScalarArrayOpExprState +ScalarIOData ScalarItem ScalarMCVItem Scan @@ -1745,6 +2187,8 @@ ScanDirection ScanKey ScanKeyData ScanKeyword +ScanKeywordHashFunc +ScanKeywordList ScanStackEntry ScanState ScanTypeControl @@ -1753,23 +2197,30 @@ SecBuffer SecBufferDesc SecLabelItem SecLabelStmt +SeenRelsEntry SelectStmt Selectivity +SemTPadded SemiAntiJoinFactors SeqScan SeqScanState SeqTable SeqTableData SerCommitSeqNo +SerializedActiveRelMaps +SerializedReindexState SerializedSnapshotData Session +SessionBackupState SetConstraintState SetConstraintStateData SetConstraintTriggerData +SetExprState SetFunctionReturnMode SetOp SetOpCmd SetOpHashEntry +SetOpPath SetOpState SetOpStatePerGroup SetOpStatePerGroupData @@ -1778,8 +2229,13 @@ SetOperation SetOperationStmt SetToDefault SetupWorkerPtr +SetupWorkerPtrType +SharedBitmapState SharedDependencyObjectType SharedDependencyType +SharedExecutorInstrumentation +SharedFileSet +SharedHashInfo SharedInvalCatalogMsg SharedInvalCatcacheMsg SharedInvalRelcacheMsg @@ -1787,18 +2243,40 @@ SharedInvalRelmapMsg SharedInvalSmgrMsg SharedInvalSnapshotMsg SharedInvalidationMessage +SharedJitInstrumentation +SharedRecordTableEntry +SharedRecordTableKey +SharedRecordTypmodRegistry +SharedSortInfo +SharedTuplestore +SharedTuplestoreAccessor +SharedTuplestoreChunk +SharedTuplestoreParticipant +SharedTypmodTableEntry +Sharedsort ShellTypeInfo +ShippableCacheEntry +ShippableCacheKey ShmemIndexEnt +ShutdownForeignScan_function ShutdownInformation ShutdownMode SignTSVector +SimpleActionList +SimpleActionListCell SimpleEcontextStackEntry SimpleOidList SimpleOidListCell +SimpleStats SimpleStringList SimpleStringListCell SingleBoundSortItem Size +SlabBlock +SlabChunk +SlabContext +SlabSlot +SlotErrCallbackArg SlotNumber SlruCtl SlruCtlData @@ -1820,7 +2298,10 @@ Sort SortBy SortByDir SortByNulls +SortCoordinate SortGroupClause +SortItem +SortPath SortShimExtra SortState SortSupport @@ -1845,9 +2326,11 @@ SpGistPageOpaque SpGistPageOpaqueData SpGistScanOpaque SpGistScanOpaqueData +SpGistSearchItem SpGistState SpGistTypeDesc SpecialJoinInfo +SpinDelayStatus SplitInterval SplitLR SplitVar @@ -1855,19 +2338,29 @@ SplitedPageLayout StackElem StandardChunkHeader StartBlobPtr +StartBlobPtrType StartBlobsPtr +StartBlobsPtrType StartDataPtr +StartDataPtrType StartReplicationCmd StartupPacket +StartupStatusEnum StatEntry +StatExtEntry StatMsgType StateFileChunk +StatisticExtInfo Stats +StatsData +StatsExtInfo StdAnalyzeData StdRdOptions Step StopList +StopWorkersData StrategyNumber +StreamCtl StringInfo StringInfoData StripnullState @@ -1879,20 +2372,32 @@ SubTransactionId SubXactCallback SubXactCallbackItem SubXactEvent +SubplanResultRelHashElem SubqueryScan +SubqueryScanPath SubqueryScanState +Subscription +SubscriptionInfo +SubscriptionRelState Syn +SyncRepConfigData SysScanDesc SyscacheCallbackFunction +SystemRowsSamplerData SystemSamplerData +SystemTimeSamplerData TAR_MEMBER TBMIterateResult +TBMIteratingState TBMIterator +TBMSharedIterator +TBMSharedIteratorState TBMStatus TBlockState TIDBitmap TOKEN_DEFAULT_DACL TOKEN_INFORMATION_CLASS +TOKEN_PRIVILEGES TOKEN_USER TParser TParserCharTest @@ -1901,6 +2406,7 @@ TParserSpecial TParserState TParserStateAction TParserStateActionItem +TQueueDestReceiver TRGM TResult TSAnyCacheEntry @@ -1908,6 +2414,7 @@ TSConfigCacheEntry TSConfigInfo TSDictInfo TSDictionaryCacheEntry +TSExecuteCallback TSLexeme TSParserCacheEntry TSParserInfo @@ -1919,6 +2426,7 @@ TSReadPointer TSTemplateInfo TSTokenTypeStorage TSVector +TSVectorBuildState TSVectorData TSVectorParseState TSVectorStat @@ -1928,23 +2436,33 @@ TTOffList TYPCATEGORY T_Action T_WorkerStatus +TabStatHashEntry TabStatusArray TableDataInfo +TableFunc +TableFuncRoutine +TableFuncScan +TableFuncScanState TableInfo TableLikeClause TableSampleClause -TableSampleDesc TableSpaceCacheEntry TableSpaceOpts TablespaceList TablespaceListCell +TapeBlockTrailer +TapeShare +TarMethodData +TarMethodFile TargetEntry +TclExceptionNameMap Tcl_DString Tcl_FileProc Tcl_HashEntry Tcl_HashTable Tcl_Interp Tcl_NotifierProcs +Tcl_Obj Tcl_Time TestDecodingData TestSpec @@ -1953,6 +2471,7 @@ TextPositionState TextSortSupport TheLexeme TheSubstitute +TidExpr TidHashKey TidPath TidScan @@ -1975,6 +2494,7 @@ TmFromChar TmToChar TocEntry TokenAuxData +TokenizedLine TrackItem TransInvalidationInfo TransState @@ -1984,8 +2504,11 @@ TransactionStateData TransactionStmt TransactionStmtKind TransformInfo +TransformJsonStringValuesState +TransitionCaptureState TrgmArc TrgmArcInfo +TrgmBound TrgmColor TrgmColorInfo TrgmNFA @@ -2003,7 +2526,9 @@ TriggerDesc TriggerEvent TriggerFlags TriggerInfo +TriggerTransition TruncateStmt +TsmRoutine TupOutputState TupSortStatus TupStoreStatus @@ -2014,7 +2539,14 @@ TupleHashEntry TupleHashEntryData TupleHashIterator TupleHashTable +TupleQueueReader +TupleRemapClass +TupleRemapInfo TupleTableSlot +TupleTableSlotOps +TuplesortInstrumentation +TuplesortMethod +TuplesortSpaceType Tuplesortstate Tuplestorestate TwoPhaseCallback @@ -2034,16 +2566,24 @@ Type TypeCacheEntry TypeCacheEnumData TypeCast +TypeCat TypeFuncClass TypeInfo TypeName +U U32 U8 +UChar +UCharIterator +UCollator +UConverter +UErrorCode UINT ULARGE_INTEGER ULONG ULONG_PTR UV +UVersionInfo Unique UniquePath UniquePathMethod @@ -2052,12 +2592,15 @@ UnlistenStmt UnresolvedTup UnresolvedTupData UpdateStmt +UpperRelationKind +UpperUniquePath UserAuth UserMapping UserOpts VacAttrStats VacAttrStatsP VacuumParams +VacuumRelation VacuumStmt Value ValuesScan @@ -2066,6 +2609,8 @@ Var VarBit VarChar VarParamState +VarString +VarStringSortSupport Variable VariableAssignHook VariableCache @@ -2075,11 +2620,14 @@ VariableSetStmt VariableShowStmt VariableSpace VariableStatData +VariableSubstituteHook +VersionedQuery Vfd ViewCheckOption ViewOptions ViewStmt VirtualTransactionId +VirtualTupleTableSlot Vsrt WAITORTIMERCALLBACK WAIT_ORDER @@ -2087,6 +2635,7 @@ WALInsertLock WALInsertLockPadded WCHAR WCOKind +WFW_WaitOption WIDGET WIN32_FILE_ATTRIBUTE_DATA WORD @@ -2095,17 +2644,36 @@ WSABUF WSADATA WSANETWORKEVENTS WSAPROTOCOL_INFO +WaitEvent +WaitEventActivity +WaitEventClient +WaitEventIO +WaitEventIPC +WaitEventSet +WaitEventTimeout +WaitPMResult +WalCloseMethod WalLevel WalRcvData +WalRcvExecResult +WalRcvExecStatus WalRcvState +WalRcvStreamOptions +WalReceiverConn +WalReceiverFunctionsType WalSnd WalSndCtlData WalSndSendDataCallback WalSndState +WalTimeSample +WalWriteMethod +Walfile WholeRowVarExprState WindowAgg +WindowAggPath WindowAggState WindowClause +WindowClauseSortData WindowDef WindowFunc WindowFuncExprState @@ -2126,15 +2694,24 @@ WorkTableScan WorkTableScanState WorkerInfo WorkerInfoData +WorkerInstrumentation WorkerJobDumpPtr +WorkerJobDumpPtrType WorkerJobRestorePtr +WorkerJobRestorePtrType Working_State WriteBufPtr +WriteBufPtrType WriteBytePtr +WriteBytePtrType WriteDataPtr +WriteDataPtrType WriteExtraTocPtr +WriteExtraTocPtrType WriteFunc +WritebackContext X509 +X509_EXTENSION X509_NAME X509_NAME_ENTRY X509_STORE @@ -2165,6 +2742,7 @@ XLogSource XLogwrtResult XLogwrtRqst XPVIV +XPVMG XactCallback XactCallbackItem XactEvent @@ -2175,9 +2753,12 @@ XmlExprOp XmlExprState XmlOptionType XmlSerialize +XmlTableBuilderData YYLTYPE YYSTYPE YY_BUFFER_STATE +ZipfCache +ZipfCell _SPI_connection _SPI_plan __AssignProcessToJobObject @@ -2189,15 +2770,38 @@ __RegisterWaitForSingleObject __SetInformationJobObject _resultmap _stringlist +abs acquireLocksOnSubLinks_context adjust_appendrel_attrs_context allocfunc +ambeginscan_function +ambuild_function +ambuildempty_function +ambulkdelete_function +amcanreturn_function +amcostestimate_function +amendscan_function +amestimateparallelscan_function +amgetbitmap_function +amgettuple_function +aminitparallelscan_function +aminsert_function +ammarkpos_function +amoptions_function +amparallelrescan_function +amproperty_function +amrescan_function +amrestrpos_function +amvacuumcleanup_function +amvalidate_function array_iter array_unnest_fctx assign_collations_context autovac_table av_relation avl_dbase +avl_node +avl_tree avw_dbase backslashResult base_yy_extra_type @@ -2209,16 +2813,17 @@ bitmapword bits16 bits32 bits8 +bloom_filter bool boolean brin_column_state -brin_page_state bytea cached_re_str cashKEY celt cfp check_agg_arguments_context +check_function_callback check_network_data check_object_relabel_type check_password_hook_type @@ -2232,14 +2837,18 @@ codes_t coercion collation_cache_entry color +colormaprange config_var_value contain_aggs_of_level_context convert_testexpr_context +copy_data_source_cb core_YYSTYPE core_yy_extra_type core_yyscan_t +corrupt_items cost_qual_eval_context count_agg_clauses_context +create_upper_paths_hook_type createdb_failure_params crosstab_HashEnt crosstab_cat_desc @@ -2255,6 +2864,7 @@ deparse_expr_cxt deparse_namespace destructor dev_t +digit directory_fctx disassembledLeaf dlist_head @@ -2262,6 +2872,25 @@ dlist_iter dlist_mutable_iter dlist_node ds_state +dsa_area +dsa_area_control +dsa_area_pool +dsa_area_span +dsa_handle +dsa_pointer +dsa_pointer_atomic +dsa_segment_header +dsa_segment_index +dsa_segment_map +dshash_compare_function +dshash_hash +dshash_hash_function +dshash_parameters +dshash_partition +dshash_table +dshash_table_control +dshash_table_handle +dshash_table_item dsm_control_header dsm_control_item dsm_handle @@ -2283,6 +2912,8 @@ execution_state explain_get_index_name_hook_type f_smgr fd_set +fe_scram_state +fe_scram_state_enum file_action_t file_entry_t file_type_t @@ -2316,6 +2947,7 @@ generate_series_numeric_fctx generate_series_timestamp_fctx generate_series_timestamptz_fctx generate_subscripts_fctx +get_agg_clause_costs_context get_attavgwidth_hook_type get_index_stats_hook_type get_relation_info_hook_type @@ -2333,25 +2965,40 @@ ginxlogInsertEntry ginxlogInsertListPage ginxlogRecompressDataLeaf ginxlogSplit +ginxlogSplitDataInternal +ginxlogSplitDataLeaf +ginxlogSplitEntry ginxlogUpdateMeta ginxlogVacuumDataLeafPage +ginxlogVacuumPage +gistxlogDelete gistxlogPage gistxlogPageSplit gistxlogPageUpdate +grouping_sets_data gseg_picksplit_item gss_OID +gss_OID_desc gss_buffer_desc gss_cred_id_t gss_ctx_id_t gss_name_t gtrgm_consistent_cache gzFile +has_parallel_hazard_arg hashfunc hbaPort heap_page_items_state help_handler hlCheck +hstoreCheckKeyLen_t +hstoreCheckValLen_t +hstorePairs_t +hstoreUniquePairs_t +hstoreUpgrade_t hyperLogLogState +ifState +ilist import_error_callback_arg indexed_tlist inet @@ -2377,6 +3024,7 @@ intptr_t intvKEY itemIdSort itemIdSortData +iterator jmp_buf join_search_hook_type json_aelem_action @@ -2389,6 +3037,8 @@ lclContext lclTocEntry leafSegmentInfo line_t +lineno_t +list_qsort_comparator locale_t locate_agg_of_level_context locate_var_of_level_context @@ -2402,9 +3052,13 @@ ltree_gist ltree_level ltxtquery mXactCacheEnt +mac8KEY macKEY macaddr +macaddr8 +macaddr_sortsupport_state map_variable_attnos_context +max_parallel_hazard_context mb2wchar_with_len_converter mbcharacter_incrementer mbdisplaylen_converter @@ -2436,9 +3090,13 @@ oidKEY oidvector on_dsm_detach_callback on_exit_nicely_callback +ossl_EVP_cipher_func ossldata +other output_type pageCnvCtx +pagetable_hash +pagetable_iterator pairingheap pairingheap_comparator pairingheap_node @@ -2450,6 +3108,8 @@ pgParameterStatus pg_atomic_flag pg_atomic_uint32 pg_atomic_uint64 +pg_conn_host +pg_conn_host_type pg_conv_map pg_crc32 pg_crc32c @@ -2463,13 +3123,20 @@ pg_int64 pg_local_to_utf pg_local_to_utf_combined pg_locale_t +pg_mb_radix_tree pg_on_exit_callback pg_re_flags +pg_saslprep_rc +pg_sha224_ctx +pg_sha256_ctx +pg_sha384_ctx +pg_sha512_ctx pg_stack_base_t pg_time_t pg_tz pg_tz_cache pg_tzenum +pg_unicode_decomposition pg_utf_to_local pg_utf_to_local_combined pg_uuid_t @@ -2490,6 +3157,7 @@ pgstat_page pgstattuple_type pgthreadlock_t pid_t +pivot_field planner_hook_type plperl_array_info plperl_call_data @@ -2502,11 +3170,14 @@ plperl_query_entry plpgsql_CastHashEntry plpgsql_CastHashKey plpgsql_HashEnt +pltcl_call_state pltcl_interp_desc pltcl_proc_desc pltcl_proc_key pltcl_proc_ptr pltcl_query_desc +pointer +pos_trgm post_parse_analyze_hook_type pqbool pqsigfunc @@ -2518,15 +3189,20 @@ printTextFormat printTextLineFormat printTextLineWrap printTextRule +printfunc priv_map process_file_callback_t process_sublinks_context +proclist_head +proclist_mutable_iter +proclist_node promptStatus_t pthread_attr_t pthread_key_t pthread_mutex_t pthread_once_t pthread_t +ptrdiff_t pull_var_clause_context pull_varattnos_context pull_varnos_context @@ -2543,7 +3219,12 @@ rb_allocfunc rb_combiner rb_comparator rb_freefunc +rbt_allocfunc +rbt_combiner +rbt_comparator +rbt_freefunc reduce_outer_joins_state +reference regex_arc_t regex_t regexp @@ -2573,7 +3254,11 @@ rm_detail_t role_auth_extra row_security_policy_hook_type save_buffer +scram_HMAC_ctx +scram_state +scram_state_enum security_barrier_replace_vars_context +sem_t sequence_magic set_join_pathlist_hook_type set_rel_pathlist_hook_type @@ -2596,6 +3281,7 @@ slist_mutable_iter slist_node slock_t smgrid +socket_set spgBulkDeleteState spgChooseIn spgChooseOut @@ -2619,6 +3305,8 @@ spgxlogState spgxlogVacuumLeaf spgxlogVacuumRedirect spgxlogVacuumRoot +split_pathtarget_context +split_pathtarget_item sql_error_callback_arg sqlparseInfo sqlparseState @@ -2632,6 +3320,7 @@ stmtCacheEntry storeInfo storeRes_func stream_stop_callback +string substitute_actual_parameters_context substitute_actual_srf_parameters_context substitute_multiple_relids_context @@ -2658,9 +3347,14 @@ trgm_mb_char trivalue tsKEY ts_db_fctx +ts_parserstate +ts_tokenizer ts_tokentype tsearch_readline_state +tuplehash_hash +tuplehash_iterator txid +type tzEntry u1byte u4byte @@ -2674,6 +3368,7 @@ uint16_t uint32 uint32_t uint64 +uint64_t uint8 uint8_t uintptr_t @@ -2685,7 +3380,9 @@ unicode_linestyle unit_conversion unlogged_relation_entry utf_local_conversion_func +uuidKEY uuid_rc_t +uuid_sortsupport_state uuid_t v_i_state va_list @@ -2695,13 +3392,28 @@ varatt_expanded varattrib_1b varattrib_1b_e varattrib_4b +vbits +walrcv_check_conninfo_fn +walrcv_connect_fn walrcv_connect_type +walrcv_create_slot_fn +walrcv_disconnect_fn walrcv_disconnect_type +walrcv_endstreaming_fn walrcv_endstreaming_type +walrcv_exec_fn +walrcv_get_conninfo_fn +walrcv_get_conninfo_type +walrcv_get_senderinfo_fn +walrcv_identify_system_fn walrcv_identify_system_type +walrcv_readtimelinehistoryfile_fn walrcv_readtimelinehistoryfile_type +walrcv_receive_fn walrcv_receive_type +walrcv_send_fn walrcv_send_type +walrcv_startstreaming_fn walrcv_startstreaming_type wchar2mb_with_len_converter wchar_t @@ -2710,7 +3422,9 @@ win32_pthread wint_t worker_state worktable +wrap xl_brin_createidx +xl_brin_desummarize xl_brin_insert xl_brin_revmap_extend xl_brin_samepage_update @@ -2724,10 +3438,24 @@ xl_btree_reuse_page xl_btree_split xl_btree_unlink_page xl_btree_vacuum +xl_btreetid +xl_clog_truncate xl_commit_ts_set +xl_commit_ts_truncate xl_dbase_create_rec xl_dbase_drop_rec xl_end_of_recovery +xl_hash_add_ovfl_page +xl_hash_delete +xl_hash_init_bitmap_page +xl_hash_init_meta_page +xl_hash_insert +xl_hash_move_page_contents +xl_hash_split_allocate_page +xl_hash_split_complete +xl_hash_squeeze_page +xl_hash_update_meta_page +xl_hash_vacuum_one_page xl_heap_clean xl_heap_cleanup_info xl_heap_confirm @@ -2735,19 +3463,26 @@ xl_heap_delete xl_heap_freeze_page xl_heap_freeze_tuple xl_heap_header +xl_heap_header_len xl_heap_inplace xl_heap_insert xl_heap_lock xl_heap_lock_updated xl_heap_multi_insert xl_heap_new_cid +xl_heap_newpage xl_heap_rewrite_mapping +xl_heap_truncate xl_heap_update xl_heap_visible +xl_heaptid xl_invalid_page xl_invalid_page_key +xl_invalidations +xl_logical_message xl_multi_insert_tuple xl_multixact_create +xl_multixact_truncate xl_parameter_change xl_relmap_update xl_replorigin_drop @@ -2762,13 +3497,17 @@ xl_standby_locks xl_tblspc_create_rec xl_tblspc_drop_rec xl_xact_abort +xl_xact_abort_prepared xl_xact_assignment xl_xact_commit +xl_xact_commit_compact +xl_xact_commit_prepared xl_xact_dbinfo xl_xact_invals xl_xact_origin xl_xact_parsed_abort xl_xact_parsed_commit +xl_xact_parsed_prepare xl_xact_relfilenodes xl_xact_subxacts xl_xact_twophase