diff --git a/src/backend/columnar/columnar_storage.c b/src/backend/columnar/columnar_storage.c index 7e7f7990b..21aa7ab9c 100644 --- a/src/backend/columnar/columnar_storage.c +++ b/src/backend/columnar/columnar_storage.c @@ -169,7 +169,11 @@ ColumnarStorageInit(SMgrRelation srel, uint64 storageId) } /* create two pages */ +#if PG_VERSION_NUM >= PG_VERSION_16 + PGIOAlignedBlock block; +#else PGAlignedBlock block; +#endif Page page = block.data; /* write metapage */ diff --git a/src/backend/distributed/planner/insert_select_planner.c b/src/backend/distributed/planner/insert_select_planner.c index f990a06bc..b71d95432 100644 --- a/src/backend/distributed/planner/insert_select_planner.c +++ b/src/backend/distributed/planner/insert_select_planner.c @@ -901,15 +901,7 @@ RouterModifyTaskForShardInterval(Query *originalQuery, continue; } - - /* - * passing NULL for plannerInfo will be problematic if we have placeholder - * vars. However, it won't be the case here because we are building - * the expression from shard intervals which don't have placeholder vars. - * Note that this is only the case with PG14 as the parameter doesn't exist - * prior to that. - */ - shardRestrictionList = make_simple_restrictinfo(NULL, + shardRestrictionList = make_simple_restrictinfo(restriction->plannerInfo, (Expr *) shardOpExpressions); extendedBaseRestrictInfo = lappend(extendedBaseRestrictInfo, shardRestrictionList); diff --git a/src/backend/distributed/planner/relation_restriction_equivalence.c b/src/backend/distributed/planner/relation_restriction_equivalence.c index b57e37735..af2443b19 100644 --- a/src/backend/distributed/planner/relation_restriction_equivalence.c +++ b/src/backend/distributed/planner/relation_restriction_equivalence.c @@ -171,6 +171,8 @@ static bool FindQueryContainingRTEIdentityInternal(Node *node, static int ParentCountPriorToAppendRel(List *appendRelList, AppendRelInfo *appendRelInfo); +static bool IsVarRelOptOuterJoin(PlannerInfo *root, Var *varToBeAdded); + /* * AllDistributionKeysInQueryAreEqual returns true if either @@ -1238,6 +1240,12 @@ AddToAttributeEquivalenceClass(AttributeEquivalenceClass *attributeEquivalenceCl return; } + /* outer join checks in PG16 */ + if (IsVarRelOptOuterJoin(root, varToBeAdded)) + { + return; + } + RangeTblEntry *rangeTableEntry = root->simple_rte_array[varToBeAdded->varno]; if (rangeTableEntry->rtekind == RTE_RELATION) { @@ -1379,6 +1387,30 @@ GetTargetSubquery(PlannerInfo *root, RangeTblEntry *rangeTableEntry, Var *varToB } +/* + * IsVarRelOptOuterJoin returns true if the Var to be added + * is an outer join, false otherwise. + */ +static bool +IsVarRelOptOuterJoin(PlannerInfo *root, Var *varToBeAdded) +{ +#if PG_VERSION_NUM >= PG_VERSION_16 + if (root->simple_rel_array_size <= varToBeAdded->varno) + { + return true; + } + + RelOptInfo *rel = root->simple_rel_array[varToBeAdded->varno]; + if (rel == NULL) + { + /* must be an outer join */ + return true; + } +#endif + return false; +} + + /* * AddUnionAllSetOperationsToAttributeEquivalenceClass recursively iterates on all the * append rels, sets the varno's accordingly and adds the diff --git a/src/backend/distributed/replication/multi_logical_replication.c b/src/backend/distributed/replication/multi_logical_replication.c index 550095875..c8d0325b6 100644 --- a/src/backend/distributed/replication/multi_logical_replication.c +++ b/src/backend/distributed/replication/multi_logical_replication.c @@ -1530,7 +1530,23 @@ CreateSubscriptions(MultiConnection *sourceConnection, appendStringInfo(createSubscriptionCommand, "CREATE SUBSCRIPTION %s CONNECTION %s PUBLICATION %s " "WITH (citus_use_authinfo=true, create_slot=false, " +#if PG_VERSION_NUM >= PG_VERSION_16 + + /* + * password_required specifies whether connections to the publisher + * made as a result of this subscription must use password authentication. + * However, this setting is ignored when the subscription is owned + * by a superuser. + * Given that this command is executed below with superuser + * ExecuteCriticalRemoteCommand(target->superuserConnection, + * createSubscriptionCommand->data); + * We are safe to pass password_required as false because + * it will be ignored anyway + */ + "copy_data=false, enabled=false, slot_name=%s, password_required=false", +#else "copy_data=false, enabled=false, slot_name=%s", +#endif quote_identifier(target->subscriptionName), quote_literal_cstr(conninfo->data), quote_identifier(target->publication->name), diff --git a/src/test/regress/bin/normalize.sed b/src/test/regress/bin/normalize.sed index a374c73f5..7bed04edf 100644 --- a/src/test/regress/bin/normalize.sed +++ b/src/test/regress/bin/normalize.sed @@ -294,3 +294,12 @@ s/\/\*\{"cId":.*\*\///g # Notice message that contains current columnar version that makes it harder to bump versions s/(NOTICE: issuing CREATE EXTENSION IF NOT EXISTS citus_columnar WITH SCHEMA pg_catalog VERSION )"[0-9]+\.[0-9]+-[0-9]+"/\1 "x.y-z"/ + +# pg16 changes +# can be removed when dropping PG14&15 support +#if PG_VERSION_NUM < PG_VERSION_16 +# (This is not preprocessor directive, but a reminder for the developer that will drop PG14&15 support ) + +s/, password_required=false//g + +#endif /* PG_VERSION_NUM < PG_VERSION_16 */