=== Applying patches on top of PostgreSQL commit ID 68a8601ee9ec7285b5a3839e17360c0a9d0e52a3 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Tue Mar 31 09:21:30 UTC 2026 On branch cf/5841 nothing to commit, working tree clean === using 'git am' to apply patch ./v48-0001-Make-it-cheap-to-check-if-a-relation-is-modified.patch === Applying: Make it cheap to check if a relation is modified by a query Using index info to reconstruct a base tree... M src/backend/executor/execParallel.c M src/backend/optimizer/plan/planner.c M src/include/nodes/plannodes.h Falling back to patching base and 3-way merge... Auto-merging src/include/nodes/plannodes.h CONFLICT (content): Merge conflict in src/include/nodes/plannodes.h Auto-merging src/backend/optimizer/plan/planner.c CONFLICT (content): Merge conflict in src/backend/optimizer/plan/planner.c Auto-merging src/backend/executor/execParallel.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Make it cheap to check if a relation is modified by a query When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v48-0001-Make-it-cheap-to-check-if-a-relation-is-modified.patch === patching file src/backend/executor/execParallel.c Hunk #1 succeeded at 188 with fuzz 2. patching file src/backend/optimizer/plan/planner.c Hunk #1 FAILED at 340. Hunk #2 FAILED at 661. 2 out of 2 hunks FAILED -- saving rejects to file src/backend/optimizer/plan/planner.c.rej patching file src/include/nodes/plannodes.h Hunk #1 succeeded at 120 with fuzz 2 (offset -1 lines). Hunk #2 succeeded at 143 with fuzz 2 (offset 2 lines). Unstaged changes after reset: M src/backend/executor/execParallel.c M src/include/nodes/plannodes.h Removing src/backend/optimizer/plan/planner.c.rej === using 'git apply' to apply patch ./v48-0001-Make-it-cheap-to-check-if-a-relation-is-modified.patch === Applied patch to 'src/backend/executor/execParallel.c' cleanly. Applied patch to 'src/backend/optimizer/plan/planner.c' with conflicts. Applied patch to 'src/include/nodes/plannodes.h' with conflicts. U src/backend/optimizer/plan/planner.c U src/include/nodes/plannodes.h diff --cc src/backend/optimizer/plan/planner.c index 07944612668,df4c99fc3ff..00000000000 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@@ -664,14 -667,16 +666,27 @@@ standard_planner(Query *parse, const ch /* * Compute resultRelationRelids and rowMarkRelids from resultRelations and ++<<<<<<< ours + * rowMarks. These can be used for cheap membership checks. + */ + foreach(lc, glob->resultRelations) + result->resultRelationRelids = bms_add_member(result->resultRelationRelids, + lfirst_int(lc)); + foreach(lc, glob->finalrowmarks) + result->rowMarkRelids = bms_add_member(result->rowMarkRelids, + ((PlanRowMark *) lfirst(lc))->rti); ++======= + * rowMarks for quick access. + */ + foreach(lc, glob->resultRelations) + resultRelationRelids = bms_add_member(resultRelationRelids, + lfirst_int(lc)); + foreach(lc, glob->finalrowmarks) + rowMarkRelids = bms_add_member(rowMarkRelids, + ((PlanRowMark *) lfirst(lc))->rti); + result->resultRelationRelids = resultRelationRelids; + result->rowMarkRelids = rowMarkRelids; ++>>>>>>> theirs result->relationOids = glob->relationOids; result->invalItems = glob->invalItems; diff --cc src/include/nodes/plannodes.h index e2c00576d41,88be65d7bde..00000000000 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@@ -117,9 -117,13 +117,12 @@@ typedef struct PlannedStm */ List *permInfos; - /* rtable indexes of target relations for INSERT/UPDATE/DELETE/MERGE */ - /* integer list of RT indexes, or NIL */ - List *resultRelations; + /* RT indexes of relations targeted by INSERT/UPDATE/DELETE/MERGE */ + Bitmapset *resultRelationRelids; + /* RT indexes of result relations targeted by INSERT/UPDATE/DELETE/MERGE */ + Bitmapset *resultRelationRelids; + /* list of AppendRelInfo nodes */ List *appendRelations; @@@ -137,7 -141,10 +140,14 @@@ /* a list of PlanRowMark's */ List *rowMarks; ++<<<<<<< ours + /* RT indexes of relations with row marks */ ++======= + /* + * RT indexes of relations with row marks. Useful for quick membership + * checks instead of iterating through rowMarks. + */ ++>>>>>>> theirs Bitmapset *rowMarkRelids; /* OIDs of relations the plan depends on */