diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 4dd24ca5..ffb67d95 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -11,6 +11,9 @@ RUN apk add --no-cache \ zlib-dev libedit-dev \ pkgconf icu-dev clang clang15 clang-analyzer; +# Need this for Travis CI to pass +RUN if [ "${PG_VERSION}" == "13" ] ; then apk add --no-cache clang19; fi + # Install fresh valgrind RUN apk add valgrind \ --update-cache \ diff --git a/patches/REL_14_STABLE-pg_pathman-core.diff b/patches/REL_14_STABLE-pg_pathman-core.diff index a6ac1afa..c180a3bb 100644 --- a/patches/REL_14_STABLE-pg_pathman-core.diff +++ b/patches/REL_14_STABLE-pg_pathman-core.diff @@ -1,5 +1,5 @@ diff --git a/contrib/Makefile b/contrib/Makefile -index f27e458482..ea47c341c1 100644 +index f27e458482e..ea47c341c11 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -32,6 +32,7 @@ SUBDIRS = \ @@ -11,7 +11,7 @@ index f27e458482..ea47c341c1 100644 pg_stat_statements \ pg_surgery \ diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c -index bf551b0395..10d2044ae6 100644 +index 3f0f711307d..a631b969e25 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -76,7 +76,7 @@ int DefaultXactIsoLevel = XACT_READ_COMMITTED; @@ -24,10 +24,10 @@ index bf551b0395..10d2044ae6 100644 bool DefaultXactDeferrable = false; bool XactDeferrable; diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c -index bdf59a10fc..972453d9a5 100644 +index 4b31a85a24d..5366e67877a 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c -@@ -1799,6 +1799,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) +@@ -1811,6 +1811,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) } out: @@ -45,10 +45,10 @@ index bdf59a10fc..972453d9a5 100644 return state->resvalue; } diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c -index b3ce4bae53..8f2bb12542 100644 +index 5d6410480cd..33a522514d9 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c -@@ -824,6 +824,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) +@@ -818,6 +818,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) estate->es_plannedstmt = plannedstmt; @@ -62,7 +62,7 @@ index b3ce4bae53..8f2bb12542 100644 /* * Next, build the ExecRowMark array from the PlanRowMark(s), if any. */ -@@ -2713,6 +2720,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) +@@ -2777,6 +2784,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) rcestate->es_junkFilter = parentestate->es_junkFilter; rcestate->es_output_cid = parentestate->es_output_cid; @@ -77,10 +77,10 @@ index b3ce4bae53..8f2bb12542 100644 * ResultRelInfos needed by subplans are initialized from scratch when the * subplans themselves are initialized. diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c -index 55c430c9ec..21d9e6304a 100644 +index ae1b07847b1..989ba4f7b11 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c -@@ -510,7 +510,7 @@ ExecInitInsertProjection(ModifyTableState *mtstate, +@@ -538,7 +538,7 @@ ExecInitInsertProjection(ModifyTableState *mtstate, * This is also a convenient place to verify that the output of an UPDATE * matches the target table (ExecBuildUpdateProjection does that). */ @@ -89,15 +89,15 @@ index 55c430c9ec..21d9e6304a 100644 ExecInitUpdateProjection(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo) { -@@ -2486,6 +2486,7 @@ ExecModifyTable(PlanState *pstate) - ItemPointerData tuple_ctid; +@@ -2541,6 +2541,7 @@ ExecModifyTable(PlanState *pstate) HeapTupleData oldtupdata; HeapTuple oldtuple; + bool tuplock; + ResultRelInfo *saved_resultRelInfo; CHECK_FOR_INTERRUPTS(); -@@ -2523,12 +2524,23 @@ ExecModifyTable(PlanState *pstate) +@@ -2578,12 +2579,23 @@ ExecModifyTable(PlanState *pstate) resultRelInfo = node->resultRelInfo + node->mt_lastResultIndex; subplanstate = outerPlanState(node); @@ -121,7 +121,7 @@ index 55c430c9ec..21d9e6304a 100644 /* * Reset the per-output-tuple exprcontext. This is needed because * triggers expect to use that context as workspace. It's a bit ugly -@@ -2562,7 +2574,9 @@ ExecModifyTable(PlanState *pstate) +@@ -2617,7 +2629,9 @@ ExecModifyTable(PlanState *pstate) bool isNull; Oid resultoid; @@ -132,7 +132,7 @@ index 55c430c9ec..21d9e6304a 100644 &isNull); if (isNull) elog(ERROR, "tableoid is NULL"); -@@ -2581,6 +2595,8 @@ ExecModifyTable(PlanState *pstate) +@@ -2636,6 +2650,8 @@ ExecModifyTable(PlanState *pstate) if (resultRelInfo->ri_usesFdwDirectModify) { Assert(resultRelInfo->ri_projectReturning); @@ -141,7 +141,7 @@ index 55c430c9ec..21d9e6304a 100644 /* * A scan slot containing the data that was actually inserted, -@@ -2590,6 +2606,7 @@ ExecModifyTable(PlanState *pstate) +@@ -2645,6 +2661,7 @@ ExecModifyTable(PlanState *pstate) */ slot = ExecProcessReturning(resultRelInfo, NULL, planSlot); @@ -149,7 +149,7 @@ index 55c430c9ec..21d9e6304a 100644 return slot; } -@@ -2619,7 +2636,8 @@ ExecModifyTable(PlanState *pstate) +@@ -2674,7 +2691,8 @@ ExecModifyTable(PlanState *pstate) { /* ri_RowIdAttNo refers to a ctid attribute */ Assert(AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)); @@ -159,7 +159,7 @@ index 55c430c9ec..21d9e6304a 100644 resultRelInfo->ri_RowIdAttNo, &isNull); /* shouldn't ever get a null result... */ -@@ -2649,7 +2667,8 @@ ExecModifyTable(PlanState *pstate) +@@ -2704,7 +2722,8 @@ ExecModifyTable(PlanState *pstate) */ else if (AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)) { @@ -169,7 +169,7 @@ index 55c430c9ec..21d9e6304a 100644 resultRelInfo->ri_RowIdAttNo, &isNull); /* shouldn't ever get a null result... */ -@@ -2680,8 +2699,12 @@ ExecModifyTable(PlanState *pstate) +@@ -2735,8 +2754,12 @@ ExecModifyTable(PlanState *pstate) /* Initialize projection info if first time for this table */ if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitInsertProjection(node, resultRelInfo); @@ -184,7 +184,7 @@ index 55c430c9ec..21d9e6304a 100644 estate, node->canSetTag); break; case CMD_UPDATE: -@@ -2689,6 +2712,13 @@ ExecModifyTable(PlanState *pstate) +@@ -2746,6 +2769,13 @@ ExecModifyTable(PlanState *pstate) if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitUpdateProjection(node, resultRelInfo); @@ -198,7 +198,7 @@ index 55c430c9ec..21d9e6304a 100644 /* * Make the new tuple by combining plan's output tuple with * the old tuple being updated. -@@ -2712,14 +2742,19 @@ ExecModifyTable(PlanState *pstate) +@@ -2775,9 +2805,12 @@ ExecModifyTable(PlanState *pstate) } slot = ExecGetUpdateNewTuple(resultRelInfo, planSlot, oldSlot); @@ -211,6 +211,9 @@ index 55c430c9ec..21d9e6304a 100644 + tupleid, oldtuple, slot, planSlot, &node->mt_epqstate, estate, node->canSetTag); + if (tuplock) +@@ -2785,7 +2818,9 @@ ExecModifyTable(PlanState *pstate) + InplaceUpdateTupleLock); break; case CMD_DELETE: - slot = ExecDelete(node, resultRelInfo, tupleid, oldtuple, @@ -220,7 +223,7 @@ index 55c430c9ec..21d9e6304a 100644 planSlot, &node->mt_epqstate, estate, true, /* processReturning */ node->canSetTag, -@@ -2736,7 +2771,10 @@ ExecModifyTable(PlanState *pstate) +@@ -2802,7 +2837,10 @@ ExecModifyTable(PlanState *pstate) * the work on next call. */ if (slot) @@ -231,7 +234,7 @@ index 55c430c9ec..21d9e6304a 100644 } /* -@@ -2752,6 +2790,7 @@ ExecModifyTable(PlanState *pstate) +@@ -2818,6 +2856,7 @@ ExecModifyTable(PlanState *pstate) node->mt_done = true; @@ -239,7 +242,7 @@ index 55c430c9ec..21d9e6304a 100644 return NULL; } -@@ -2826,6 +2865,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -2892,6 +2931,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) ListCell *l; int i; Relation rel; @@ -247,7 +250,7 @@ index 55c430c9ec..21d9e6304a 100644 /* check for unsupported flags */ Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); -@@ -2922,6 +2962,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -2991,6 +3031,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) i++; } @@ -261,7 +264,7 @@ index 55c430c9ec..21d9e6304a 100644 /* * Now we may initialize the subplan. */ -@@ -3002,6 +3049,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -3071,6 +3118,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) ExecInitStoredGenerated(resultRelInfo, estate, operation); } @@ -271,7 +274,7 @@ index 55c430c9ec..21d9e6304a 100644 * If this is an inherited update/delete, there will be a junk attribute * named "tableoid" present in the subplan's targetlist. It will be used diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c -index 381d9e548d..0a4657d291 100644 +index 381d9e548d1..0a4657d2915 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -25,7 +25,7 @@ @@ -284,7 +287,7 @@ index 381d9e548d..0a4657d291 100644 volatile sig_atomic_t InterruptPending = false; volatile sig_atomic_t QueryCancelPending = false; diff --git a/src/include/access/xact.h b/src/include/access/xact.h -index 5af78bd0dc..0c13bc9d83 100644 +index 5af78bd0dc7..0c13bc9d83b 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -53,7 +53,9 @@ extern PGDLLIMPORT int XactIsoLevel; @@ -299,7 +302,7 @@ index 5af78bd0dc..0c13bc9d83 100644 /* flag for logging statements in this transaction */ extern bool xact_is_sampled; diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h -index 2b4e104bb9..80d1274efe 100644 +index 3903e7a6f2e..49509a56c2d 100644 --- a/src/include/catalog/objectaddress.h +++ b/src/include/catalog/objectaddress.h @@ -28,7 +28,7 @@ typedef struct ObjectAddress @@ -312,10 +315,10 @@ index 2b4e104bb9..80d1274efe 100644 #define ObjectAddressSubSet(addr, class_id, object_id, object_sub_id) \ do { \ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h -index 3dc03c913e..1002d97499 100644 +index 4bb1744286a..af86e081918 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h -@@ -657,5 +657,7 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, +@@ -663,5 +663,7 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache); @@ -324,7 +327,7 @@ index 3dc03c913e..1002d97499 100644 #endif /* EXECUTOR_H */ diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h -index 4acb1cda6e..fd8d38347d 100644 +index 4acb1cda6ea..fd8d38347d3 100644 --- a/src/include/libpq/libpq-be.h +++ b/src/include/libpq/libpq-be.h @@ -327,7 +327,7 @@ extern ssize_t be_gssapi_read(Port *port, void *ptr, size_t len); @@ -337,10 +340,10 @@ index 4acb1cda6e..fd8d38347d 100644 /* TCP keepalives configuration. These are no-ops on an AF_UNIX socket. */ diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h -index ee5ad3c058..dc474819d7 100644 +index 801d7630e9d..400814f0618 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h -@@ -592,6 +592,12 @@ typedef struct EState +@@ -593,6 +593,12 @@ typedef struct EState * es_result_relations in no * specific order */ @@ -354,7 +357,7 @@ index ee5ad3c058..dc474819d7 100644 /* diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h -index 33e6c14e81..abd9bba23e 100644 +index 33e6c14e819..abd9bba23e3 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -53,7 +53,7 @@ extern TimestampTz GetSnapshotCurrentTimestamp(void); @@ -367,7 +370,7 @@ index 33e6c14e81..abd9bba23e 100644 extern PGDLLIMPORT TransactionId TransactionXmin; extern PGDLLIMPORT TransactionId RecentXmin; diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm -index de22c9ba2c..c8be5323b8 100644 +index de22c9ba2c7..c8be5323b8f 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -30,6 +30,18 @@ my @client_program_files = ( @@ -399,7 +402,7 @@ index de22c9ba2c..c8be5323b8 100644 sub CopyIncludeFiles diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm -index 9b6539fb15..f8a67c6701 100644 +index 43880a0a34c..ce7b8f7ac72 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -41,7 +41,10 @@ my @contrib_uselibpq = @@ -414,7 +417,7 @@ index 9b6539fb15..f8a67c6701 100644 my $contrib_extrasource = { 'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ], 'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ], -@@ -973,6 +976,7 @@ sub AddContrib +@@ -977,6 +980,7 @@ sub AddContrib my $dn = $1; my $proj = $solution->AddProject($dn, 'dll', 'contrib', "$subdir/$n"); $proj->AddReference($postgres); @@ -422,7 +425,7 @@ index 9b6539fb15..f8a67c6701 100644 AdjustContribProj($proj); } elsif ($mf =~ /^MODULES\s*=\s*(.*)$/mg) -@@ -1002,6 +1006,19 @@ sub AddContrib +@@ -1006,6 +1010,19 @@ sub AddContrib return; } @@ -442,7 +445,7 @@ index 9b6539fb15..f8a67c6701 100644 sub GenerateContribSqlFiles { my $n = shift; -@@ -1026,23 +1043,53 @@ sub GenerateContribSqlFiles +@@ -1030,23 +1047,53 @@ sub GenerateContribSqlFiles substr($l, 0, index($l, '$(addsuffix ')) . substr($l, $i + 1); } diff --git a/patches/REL_15_STABLE-pg_pathman-core.diff b/patches/REL_15_STABLE-pg_pathman-core.diff index b8db29fd..faafd713 100644 --- a/patches/REL_15_STABLE-pg_pathman-core.diff +++ b/patches/REL_15_STABLE-pg_pathman-core.diff @@ -1,5 +1,5 @@ diff --git a/contrib/Makefile b/contrib/Makefile -index bbf220407b..9a82a2db04 100644 +index bbf220407b0..9a82a2db046 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -34,6 +34,7 @@ SUBDIRS = \ @@ -11,7 +11,7 @@ index bbf220407b..9a82a2db04 100644 pg_stat_statements \ pg_surgery \ diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c -index 7a3d9b4b01..0c3d2dec6c 100644 +index 7a3d9b4b012..0c3d2dec6c2 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -78,7 +78,7 @@ int DefaultXactIsoLevel = XACT_READ_COMMITTED; @@ -24,10 +24,10 @@ index 7a3d9b4b01..0c3d2dec6c 100644 bool DefaultXactDeferrable = false; bool XactDeferrable; diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c -index 87c7603f2b..9cc0bc0da8 100644 +index 55d42cd101d..27c3fd507d0 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c -@@ -1801,6 +1801,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) +@@ -1813,6 +1813,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) } out: @@ -45,10 +45,10 @@ index 87c7603f2b..9cc0bc0da8 100644 return state->resvalue; } diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c -index 0ba61fd547..29d93998b2 100644 +index ed4ff0246ce..dc2a5bf12a8 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c -@@ -826,6 +826,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) +@@ -820,6 +820,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) estate->es_plannedstmt = plannedstmt; @@ -62,7 +62,7 @@ index 0ba61fd547..29d93998b2 100644 /* * Next, build the ExecRowMark array from the PlanRowMark(s), if any. */ -@@ -2849,6 +2856,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) +@@ -2896,6 +2903,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) rcestate->es_junkFilter = parentestate->es_junkFilter; rcestate->es_output_cid = parentestate->es_output_cid; @@ -77,10 +77,10 @@ index 0ba61fd547..29d93998b2 100644 * ResultRelInfos needed by subplans are initialized from scratch when the * subplans themselves are initialized. diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c -index 1ad5dcb406..047508e0da 100644 +index 2cf118c90f0..2a8011854fa 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c -@@ -641,6 +641,13 @@ ExecInitUpdateProjection(ModifyTableState *mtstate, +@@ -670,6 +670,13 @@ ExecInitUpdateProjection(ModifyTableState *mtstate, resultRelInfo->ri_projectNewInfoValid = true; } @@ -94,15 +94,15 @@ index 1ad5dcb406..047508e0da 100644 /* * ExecGetInsertNewTuple * This prepares a "new" tuple ready to be inserted into given result -@@ -3581,6 +3588,7 @@ ExecModifyTable(PlanState *pstate) - HeapTupleData oldtupdata; +@@ -3750,6 +3757,7 @@ ExecModifyTable(PlanState *pstate) HeapTuple oldtuple; ItemPointer tupleid; + bool tuplock; + ResultRelInfo *saved_resultRelInfo; CHECK_FOR_INTERRUPTS(); -@@ -3622,6 +3630,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3791,6 +3799,8 @@ ExecModifyTable(PlanState *pstate) context.mtstate = node; context.epqstate = &node->mt_epqstate; context.estate = estate; @@ -111,7 +111,7 @@ index 1ad5dcb406..047508e0da 100644 /* * Fetch rows from subplan, and execute the required table modification -@@ -3629,6 +3639,14 @@ ExecModifyTable(PlanState *pstate) +@@ -3798,6 +3808,14 @@ ExecModifyTable(PlanState *pstate) */ for (;;) { @@ -126,7 +126,7 @@ index 1ad5dcb406..047508e0da 100644 /* * Reset the per-output-tuple exprcontext. This is needed because * triggers expect to use that context as workspace. It's a bit ugly -@@ -3662,7 +3680,9 @@ ExecModifyTable(PlanState *pstate) +@@ -3831,7 +3849,9 @@ ExecModifyTable(PlanState *pstate) bool isNull; Oid resultoid; @@ -137,7 +137,7 @@ index 1ad5dcb406..047508e0da 100644 &isNull); if (isNull) { -@@ -3699,6 +3719,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3868,6 +3888,8 @@ ExecModifyTable(PlanState *pstate) if (resultRelInfo->ri_usesFdwDirectModify) { Assert(resultRelInfo->ri_projectReturning); @@ -146,7 +146,7 @@ index 1ad5dcb406..047508e0da 100644 /* * A scan slot containing the data that was actually inserted, -@@ -3708,6 +3730,7 @@ ExecModifyTable(PlanState *pstate) +@@ -3877,6 +3899,7 @@ ExecModifyTable(PlanState *pstate) */ slot = ExecProcessReturning(resultRelInfo, NULL, context.planSlot); @@ -154,7 +154,7 @@ index 1ad5dcb406..047508e0da 100644 return slot; } -@@ -3738,7 +3761,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3907,7 +3930,8 @@ ExecModifyTable(PlanState *pstate) { /* ri_RowIdAttNo refers to a ctid attribute */ Assert(AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)); @@ -164,7 +164,7 @@ index 1ad5dcb406..047508e0da 100644 resultRelInfo->ri_RowIdAttNo, &isNull); -@@ -3786,7 +3810,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3955,7 +3979,8 @@ ExecModifyTable(PlanState *pstate) */ else if (AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)) { @@ -174,7 +174,7 @@ index 1ad5dcb406..047508e0da 100644 resultRelInfo->ri_RowIdAttNo, &isNull); /* shouldn't ever get a null result... */ -@@ -3817,9 +3842,12 @@ ExecModifyTable(PlanState *pstate) +@@ -3986,9 +4011,12 @@ ExecModifyTable(PlanState *pstate) /* Initialize projection info if first time for this table */ if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitInsertProjection(node, resultRelInfo); @@ -190,7 +190,7 @@ index 1ad5dcb406..047508e0da 100644 break; case CMD_UPDATE: -@@ -3827,6 +3855,13 @@ ExecModifyTable(PlanState *pstate) +@@ -3998,6 +4026,13 @@ ExecModifyTable(PlanState *pstate) if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitUpdateProjection(node, resultRelInfo); @@ -204,7 +204,7 @@ index 1ad5dcb406..047508e0da 100644 /* * Make the new tuple by combining plan's output tuple with * the old tuple being updated. -@@ -3850,14 +3885,19 @@ ExecModifyTable(PlanState *pstate) +@@ -4027,9 +4062,12 @@ ExecModifyTable(PlanState *pstate) slot = ExecGetUpdateNewTuple(resultRelInfo, context.planSlot, oldSlot); context.relaction = NULL; @@ -216,6 +216,9 @@ index 1ad5dcb406..047508e0da 100644 + estate->es_result_relation_info : resultRelInfo, + tupleid, oldtuple, slot, node->canSetTag); + if (tuplock) + UnlockTuple(resultRelInfo->ri_RelationDesc, tupleid, +@@ -4037,7 +4075,9 @@ ExecModifyTable(PlanState *pstate) break; case CMD_DELETE: @@ -226,7 +229,7 @@ index 1ad5dcb406..047508e0da 100644 true, false, node->canSetTag, NULL, NULL, NULL); break; -@@ -3875,7 +3915,10 @@ ExecModifyTable(PlanState *pstate) +@@ -4055,7 +4095,10 @@ ExecModifyTable(PlanState *pstate) * the work on next call. */ if (slot) @@ -237,7 +240,7 @@ index 1ad5dcb406..047508e0da 100644 } /* -@@ -3891,6 +3934,7 @@ ExecModifyTable(PlanState *pstate) +@@ -4071,6 +4114,7 @@ ExecModifyTable(PlanState *pstate) node->mt_done = true; @@ -245,7 +248,7 @@ index 1ad5dcb406..047508e0da 100644 return NULL; } -@@ -3965,6 +4009,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -4145,6 +4189,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) ListCell *l; int i; Relation rel; @@ -253,7 +256,7 @@ index 1ad5dcb406..047508e0da 100644 /* check for unsupported flags */ Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); -@@ -4067,6 +4112,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -4252,6 +4297,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) i++; } @@ -267,7 +270,7 @@ index 1ad5dcb406..047508e0da 100644 /* * Now we may initialize the subplan. */ -@@ -4161,6 +4213,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -4346,6 +4398,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) ExecInitStoredGenerated(resultRelInfo, estate, operation); } @@ -277,7 +280,7 @@ index 1ad5dcb406..047508e0da 100644 * If this is an inherited update/delete/merge, there will be a junk * attribute named "tableoid" present in the subplan's targetlist. It diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c -index 1a5d29ac9b..aadca8ea47 100644 +index 1a5d29ac9ba..aadca8ea474 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -25,7 +25,7 @@ @@ -290,7 +293,7 @@ index 1a5d29ac9b..aadca8ea47 100644 volatile sig_atomic_t InterruptPending = false; volatile sig_atomic_t QueryCancelPending = false; diff --git a/src/include/access/xact.h b/src/include/access/xact.h -index 8d46a781bb..150d70cb64 100644 +index 8d46a781bbd..150d70cb649 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -53,6 +53,8 @@ extern PGDLLIMPORT int XactIsoLevel; @@ -303,10 +306,10 @@ index 8d46a781bb..150d70cb64 100644 /* flag for logging statements in this transaction */ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h -index 7cd9b2f2bf..b31a7934a4 100644 +index bce1aa6da39..982dfc1c596 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h -@@ -662,5 +662,17 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, +@@ -666,5 +666,17 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache); @@ -325,10 +328,10 @@ index 7cd9b2f2bf..b31a7934a4 100644 #endif /* EXECUTOR_H */ diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h -index 9f176b0e37..a65799dcce 100644 +index 8d831d0df6e..5b4ec77afaf 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h -@@ -624,6 +624,12 @@ typedef struct EState +@@ -626,6 +626,12 @@ typedef struct EState * es_result_relations in no * specific order */ @@ -342,7 +345,7 @@ index 9f176b0e37..a65799dcce 100644 /* diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm -index 8de79c618c..c9226ba5ad 100644 +index 8de79c618cb..c9226ba5ad4 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -30,6 +30,18 @@ my @client_program_files = ( @@ -374,7 +377,7 @@ index 8de79c618c..c9226ba5ad 100644 sub CopyIncludeFiles diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm -index 990c223a9b..cd5048f8d5 100644 +index 3cbc8a83984..c44f033ab2c 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -39,8 +39,8 @@ my $contrib_defines = {}; @@ -388,7 +391,7 @@ index 990c223a9b..cd5048f8d5 100644 my $contrib_extrasource = {}; my @contrib_excludes = ( 'bool_plperl', 'commit_ts', -@@ -967,6 +967,7 @@ sub AddContrib +@@ -969,6 +969,7 @@ sub AddContrib my $dn = $1; my $proj = $solution->AddProject($dn, 'dll', 'contrib', "$subdir/$n"); $proj->AddReference($postgres); @@ -396,7 +399,7 @@ index 990c223a9b..cd5048f8d5 100644 AdjustContribProj($proj); push @projects, $proj; } -@@ -1070,6 +1071,19 @@ sub AddContrib +@@ -1072,6 +1073,19 @@ sub AddContrib return; } @@ -416,7 +419,7 @@ index 990c223a9b..cd5048f8d5 100644 sub GenerateContribSqlFiles { my $n = shift; -@@ -1094,23 +1108,53 @@ sub GenerateContribSqlFiles +@@ -1096,23 +1110,53 @@ sub GenerateContribSqlFiles substr($l, 0, index($l, '$(addsuffix ')) . substr($l, $i + 1); } diff --git a/patches/REL_16_STABLE-pg_pathman-core.diff b/patches/REL_16_STABLE-pg_pathman-core.diff index 50dad389..0a422864 100644 --- a/patches/REL_16_STABLE-pg_pathman-core.diff +++ b/patches/REL_16_STABLE-pg_pathman-core.diff @@ -1,5 +1,5 @@ diff --git a/contrib/Makefile b/contrib/Makefile -index bbf220407b..9a82a2db04 100644 +index bbf220407b0..9a82a2db046 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -34,6 +34,7 @@ SUBDIRS = \ @@ -11,7 +11,7 @@ index bbf220407b..9a82a2db04 100644 pg_stat_statements \ pg_surgery \ diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c -index 4a2ea4adba..7cadde5499 100644 +index 4a2ea4adbaf..7cadde5499b 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -79,7 +79,7 @@ int DefaultXactIsoLevel = XACT_READ_COMMITTED; @@ -24,10 +24,10 @@ index 4a2ea4adba..7cadde5499 100644 bool DefaultXactDeferrable = false; bool XactDeferrable; diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c -index 6b7997465d..5e9e878d3b 100644 +index 30ea9627c75..8aca4d3a86b 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c -@@ -1845,6 +1845,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) +@@ -1857,6 +1857,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) } out: @@ -45,10 +45,10 @@ index 6b7997465d..5e9e878d3b 100644 return state->resvalue; } diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c -index 4c5a7bbf62..7d638aa22d 100644 +index 7ec4d14f66b..52952ed3dd8 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c -@@ -561,6 +561,39 @@ ExecutorRewind(QueryDesc *queryDesc) +@@ -554,6 +554,39 @@ ExecutorRewind(QueryDesc *queryDesc) } @@ -88,7 +88,7 @@ index 4c5a7bbf62..7d638aa22d 100644 /* * ExecCheckPermissions * Check access permissions of relations mentioned in a query -@@ -856,6 +889,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) +@@ -849,6 +882,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) estate->es_plannedstmt = plannedstmt; @@ -102,7 +102,7 @@ index 4c5a7bbf62..7d638aa22d 100644 /* * Next, build the ExecRowMark array from the PlanRowMark(s), if any. */ -@@ -2873,6 +2913,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) +@@ -2919,6 +2959,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) rcestate->es_output_cid = parentestate->es_output_cid; rcestate->es_queryEnv = parentestate->es_queryEnv; @@ -117,10 +117,10 @@ index 4c5a7bbf62..7d638aa22d 100644 * ResultRelInfos needed by subplans are initialized from scratch when the * subplans themselves are initialized. diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c -index c84caeeaee..2a355607e9 100644 +index 6597356c018..aaabca83e48 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c -@@ -660,6 +660,13 @@ ExecInitUpdateProjection(ModifyTableState *mtstate, +@@ -689,6 +689,13 @@ ExecInitUpdateProjection(ModifyTableState *mtstate, resultRelInfo->ri_projectNewInfoValid = true; } @@ -134,15 +134,15 @@ index c84caeeaee..2a355607e9 100644 /* * ExecGetInsertNewTuple * This prepares a "new" tuple ready to be inserted into given result -@@ -3570,6 +3577,7 @@ ExecModifyTable(PlanState *pstate) - HeapTupleData oldtupdata; +@@ -3770,6 +3777,7 @@ ExecModifyTable(PlanState *pstate) HeapTuple oldtuple; ItemPointer tupleid; + bool tuplock; + ResultRelInfo *saved_resultRelInfo; CHECK_FOR_INTERRUPTS(); -@@ -3611,6 +3619,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3811,6 +3819,8 @@ ExecModifyTable(PlanState *pstate) context.mtstate = node; context.epqstate = &node->mt_epqstate; context.estate = estate; @@ -151,7 +151,7 @@ index c84caeeaee..2a355607e9 100644 /* * Fetch rows from subplan, and execute the required table modification -@@ -3618,6 +3628,14 @@ ExecModifyTable(PlanState *pstate) +@@ -3818,6 +3828,14 @@ ExecModifyTable(PlanState *pstate) */ for (;;) { @@ -166,7 +166,7 @@ index c84caeeaee..2a355607e9 100644 /* * Reset the per-output-tuple exprcontext. This is needed because * triggers expect to use that context as workspace. It's a bit ugly -@@ -3651,7 +3669,9 @@ ExecModifyTable(PlanState *pstate) +@@ -3851,7 +3869,9 @@ ExecModifyTable(PlanState *pstate) bool isNull; Oid resultoid; @@ -177,7 +177,7 @@ index c84caeeaee..2a355607e9 100644 &isNull); if (isNull) { -@@ -3688,6 +3708,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3888,6 +3908,8 @@ ExecModifyTable(PlanState *pstate) if (resultRelInfo->ri_usesFdwDirectModify) { Assert(resultRelInfo->ri_projectReturning); @@ -186,7 +186,7 @@ index c84caeeaee..2a355607e9 100644 /* * A scan slot containing the data that was actually inserted, -@@ -3697,6 +3719,7 @@ ExecModifyTable(PlanState *pstate) +@@ -3897,6 +3919,7 @@ ExecModifyTable(PlanState *pstate) */ slot = ExecProcessReturning(resultRelInfo, NULL, context.planSlot); @@ -194,7 +194,7 @@ index c84caeeaee..2a355607e9 100644 return slot; } -@@ -3727,7 +3750,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3927,7 +3950,8 @@ ExecModifyTable(PlanState *pstate) { /* ri_RowIdAttNo refers to a ctid attribute */ Assert(AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)); @@ -204,7 +204,7 @@ index c84caeeaee..2a355607e9 100644 resultRelInfo->ri_RowIdAttNo, &isNull); -@@ -3775,7 +3799,8 @@ ExecModifyTable(PlanState *pstate) +@@ -3975,7 +3999,8 @@ ExecModifyTable(PlanState *pstate) */ else if (AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)) { @@ -214,7 +214,7 @@ index c84caeeaee..2a355607e9 100644 resultRelInfo->ri_RowIdAttNo, &isNull); /* shouldn't ever get a null result... */ -@@ -3806,9 +3831,12 @@ ExecModifyTable(PlanState *pstate) +@@ -4006,9 +4031,12 @@ ExecModifyTable(PlanState *pstate) /* Initialize projection info if first time for this table */ if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitInsertProjection(node, resultRelInfo); @@ -230,7 +230,7 @@ index c84caeeaee..2a355607e9 100644 break; case CMD_UPDATE: -@@ -3816,6 +3844,13 @@ ExecModifyTable(PlanState *pstate) +@@ -4018,6 +4046,13 @@ ExecModifyTable(PlanState *pstate) if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitUpdateProjection(node, resultRelInfo); @@ -244,7 +244,7 @@ index c84caeeaee..2a355607e9 100644 /* * Make the new tuple by combining plan's output tuple with * the old tuple being updated. -@@ -3839,14 +3874,19 @@ ExecModifyTable(PlanState *pstate) +@@ -4047,9 +4082,12 @@ ExecModifyTable(PlanState *pstate) slot = ExecGetUpdateNewTuple(resultRelInfo, context.planSlot, oldSlot); context.relaction = NULL; @@ -256,6 +256,9 @@ index c84caeeaee..2a355607e9 100644 + estate->es_result_relation_info : resultRelInfo, + tupleid, oldtuple, slot, node->canSetTag); + if (tuplock) + UnlockTuple(resultRelInfo->ri_RelationDesc, tupleid, +@@ -4057,7 +4095,9 @@ ExecModifyTable(PlanState *pstate) break; case CMD_DELETE: @@ -266,7 +269,7 @@ index c84caeeaee..2a355607e9 100644 true, false, node->canSetTag, NULL, NULL, NULL); break; -@@ -3864,7 +3904,10 @@ ExecModifyTable(PlanState *pstate) +@@ -4075,7 +4115,10 @@ ExecModifyTable(PlanState *pstate) * the work on next call. */ if (slot) @@ -277,7 +280,7 @@ index c84caeeaee..2a355607e9 100644 } /* -@@ -3880,6 +3923,7 @@ ExecModifyTable(PlanState *pstate) +@@ -4091,6 +4134,7 @@ ExecModifyTable(PlanState *pstate) node->mt_done = true; @@ -285,7 +288,7 @@ index c84caeeaee..2a355607e9 100644 return NULL; } -@@ -3954,6 +3998,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -4165,6 +4209,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) ListCell *l; int i; Relation rel; @@ -293,7 +296,7 @@ index c84caeeaee..2a355607e9 100644 /* check for unsupported flags */ Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); -@@ -4056,6 +4101,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -4272,6 +4317,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) i++; } @@ -307,7 +310,7 @@ index c84caeeaee..2a355607e9 100644 /* * Now we may initialize the subplan. */ -@@ -4138,6 +4190,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) +@@ -4354,6 +4406,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) } } @@ -317,7 +320,7 @@ index c84caeeaee..2a355607e9 100644 * If this is an inherited update/delete/merge, there will be a junk * attribute named "tableoid" present in the subplan's targetlist. It diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c -index 011ec18015..7b4fcb2807 100644 +index 011ec18015a..7b4fcb2807c 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -25,7 +25,7 @@ @@ -330,7 +333,7 @@ index 011ec18015..7b4fcb2807 100644 volatile sig_atomic_t InterruptPending = false; volatile sig_atomic_t QueryCancelPending = false; diff --git a/src/include/access/xact.h b/src/include/access/xact.h -index 7d3b9446e6..20030111f4 100644 +index 7d3b9446e62..20030111f4d 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -53,6 +53,8 @@ extern PGDLLIMPORT int XactIsoLevel; @@ -343,7 +346,7 @@ index 7d3b9446e6..20030111f4 100644 /* flag for logging statements in this transaction */ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h -index ac02247947..c39ae13a8e 100644 +index baef7e031ee..d1ad369dac5 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -208,6 +208,9 @@ extern void standard_ExecutorFinish(QueryDesc *queryDesc); @@ -355,8 +358,8 @@ index ac02247947..c39ae13a8e 100644 + bool ereport_on_violation); extern bool ExecCheckPermissions(List *rangeTable, List *rteperminfos, bool ereport_on_violation); - extern void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation); -@@ -676,5 +679,17 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, + extern bool ExecCheckOneRelPerms(RTEPermissionInfo *perminfo); +@@ -680,5 +683,17 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache); @@ -375,10 +378,10 @@ index ac02247947..c39ae13a8e 100644 #endif /* EXECUTOR_H */ diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h -index 869465d6f8..6bdde351d7 100644 +index 74718fa256d..a524e7310c6 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h -@@ -638,6 +638,12 @@ typedef struct EState +@@ -640,6 +640,12 @@ typedef struct EState * es_result_relations in no * specific order */ @@ -392,7 +395,7 @@ index 869465d6f8..6bdde351d7 100644 /* diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm -index 05548d7c0a..37754370e0 100644 +index 05548d7c0aa..37754370e0c 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -30,6 +30,22 @@ my @client_program_files = ( @@ -428,7 +431,7 @@ index 05548d7c0a..37754370e0 100644 sub CopyIncludeFiles diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm -index 6a79a0e037..93696f53ae 100644 +index e224f8d7480..4cfe9cf9d93 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -40,7 +40,7 @@ my @contrib_uselibpq = (); @@ -440,7 +443,7 @@ index 6a79a0e037..93696f53ae 100644 my $contrib_extrasource = {}; my @contrib_excludes = ( 'bool_plperl', 'commit_ts', -@@ -980,6 +980,7 @@ sub AddContrib +@@ -981,6 +981,7 @@ sub AddContrib my $dn = $1; my $proj = $solution->AddProject($dn, 'dll', 'contrib', "$subdir/$n"); $proj->AddReference($postgres); @@ -448,7 +451,7 @@ index 6a79a0e037..93696f53ae 100644 AdjustContribProj($proj); push @projects, $proj; } -@@ -1083,6 +1084,22 @@ sub AddContrib +@@ -1084,6 +1085,22 @@ sub AddContrib return; } @@ -471,7 +474,7 @@ index 6a79a0e037..93696f53ae 100644 sub GenerateContribSqlFiles { my $n = shift; -@@ -1107,23 +1124,59 @@ sub GenerateContribSqlFiles +@@ -1108,23 +1125,59 @@ sub GenerateContribSqlFiles substr($l, 0, index($l, '$(addsuffix ')) . substr($l, $i + 1); }