@@ -11,7 +11,7 @@ index 92184ed487..ac8abbfd03 100644
1111 auto_explain\
1212 bloom\
1313diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
14- indexa40bc14ec5..d157c3043e 100644
14+ indexab60c73c91..2f876d40c4 100644
1515--- a/src/backend/commands/explain.c
1616+++ b/src/backend/commands/explain.c
1717@@ -24,6 +24,7 @@
@@ -448,7 +448,7 @@ index 8d2a016656..a4e9c109b7 100644
448448 parallel_divisor += leader_contribution;
449449 }
450450diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
451- index83e8b34b1b..9e4e4b365b 100644
451+ index66c5e3ee80..bf4e28c17e 100644
452452--- a/src/backend/optimizer/plan/createplan.c
453453+++ b/src/backend/optimizer/plan/createplan.c
454454@@ -70,6 +70,8 @@
@@ -550,7 +550,7 @@ index 83e8b34b1b..9e4e4b365b 100644
550550
551551 /* Assign the rescan Param. */
552552 gm_plan->rescan_param = assign_special_exec_param(root);
553- @@ -1885 ,7 +1887 ,7 @@ create_projection_plan(PlannerInfo *root, ProjectionPath *best_path, int flags)
553+ @@ -1886 ,7 +1888 ,7 @@ create_projection_plan(PlannerInfo *root, ProjectionPath *best_path, int flags)
554554 /* We need a Result node */
555555 plan = (Plan *) make_result(tlist, NULL, subplan);
556556
@@ -559,7 +559,7 @@ index 83e8b34b1b..9e4e4b365b 100644
559559 }
560560
561561 return plan;
562- @@ -1986 ,7 +1988 ,7 @@ create_sort_plan(PlannerInfo *root, SortPath *best_path, int flags)
562+ @@ -1987 ,7 +1989 ,7 @@ create_sort_plan(PlannerInfo *root, SortPath *best_path, int flags)
563563 IS_OTHER_REL(best_path->subpath->parent) ?
564564 best_path->path.parent->relids : NULL);
565565
@@ -568,7 +568,7 @@ index 83e8b34b1b..9e4e4b365b 100644
568568
569569 return plan;
570570 }
571- @@ -2025 ,7 +2027 ,7 @@ create_group_plan(PlannerInfo *root, GroupPath *best_path)
571+ @@ -2026 ,7 +2028 ,7 @@ create_group_plan(PlannerInfo *root, GroupPath *best_path)
572572 subplan->targetlist),
573573 subplan);
574574
@@ -577,7 +577,7 @@ index 83e8b34b1b..9e4e4b365b 100644
577577
578578 return plan;
579579 }
580- @@ -2053 ,7 +2055 ,7 @@ create_upper_unique_plan(PlannerInfo *root, UpperUniquePath *best_path, int flag
580+ @@ -2054 ,7 +2056 ,7 @@ create_upper_unique_plan(PlannerInfo *root, UpperUniquePath *best_path, int flag
581581 best_path->path.pathkeys,
582582 best_path->numkeys);
583583
@@ -586,7 +586,7 @@ index 83e8b34b1b..9e4e4b365b 100644
586586
587587 return plan;
588588 }
589- @@ -2096 ,7 +2098 ,7 @@ create_agg_plan(PlannerInfo *root, AggPath *best_path)
589+ @@ -2097 ,7 +2099 ,7 @@ create_agg_plan(PlannerInfo *root, AggPath *best_path)
590590 best_path->numGroups,
591591 subplan);
592592
@@ -595,7 +595,7 @@ index 83e8b34b1b..9e4e4b365b 100644
595595
596596 return plan;
597597 }
598- @@ -2297 ,7 +2299 ,7 @@ create_groupingsets_plan(PlannerInfo *root, GroupingSetsPath *best_path)
598+ @@ -2298 ,7 +2300 ,7 @@ create_groupingsets_plan(PlannerInfo *root, GroupingSetsPath *best_path)
599599 subplan);
600600
601601 /* Copy cost data from Path to Plan */
@@ -604,7 +604,7 @@ index 83e8b34b1b..9e4e4b365b 100644
604604 }
605605
606606 return (Plan *) plan;
607- @@ -2353 ,7 +2355 ,7 @@ create_minmaxagg_plan(PlannerInfo *root, MinMaxAggPath *best_path)
607+ @@ -2354 ,7 +2356 ,7 @@ create_minmaxagg_plan(PlannerInfo *root, MinMaxAggPath *best_path)
608608
609609 plan = make_result(tlist, (Node *) best_path->quals, NULL);
610610
@@ -613,7 +613,7 @@ index 83e8b34b1b..9e4e4b365b 100644
613613
614614 /*
615615 * During setrefs.c, we'll need to replace references to the Agg nodes
616- @@ -2472 ,7 +2474 ,7 @@ create_windowagg_plan(PlannerInfo *root, WindowAggPath *best_path)
616+ @@ -2473 ,7 +2475 ,7 @@ create_windowagg_plan(PlannerInfo *root, WindowAggPath *best_path)
617617 wc->inRangeNullsFirst,
618618 subplan);
619619
@@ -622,7 +622,7 @@ index 83e8b34b1b..9e4e4b365b 100644
622622
623623 return plan;
624624 }
625- @@ -2508 ,7 +2510 ,7 @@ create_setop_plan(PlannerInfo *root, SetOpPath *best_path, int flags)
625+ @@ -2509 ,7 +2511 ,7 @@ create_setop_plan(PlannerInfo *root, SetOpPath *best_path, int flags)
626626 best_path->firstFlag,
627627 numGroups);
628628
@@ -631,7 +631,7 @@ index 83e8b34b1b..9e4e4b365b 100644
631631
632632 return plan;
633633 }
634- @@ -2544 ,7 +2546 ,7 @@ create_recursiveunion_plan(PlannerInfo *root, RecursiveUnionPath *best_path)
634+ @@ -2545 ,7 +2547 ,7 @@ create_recursiveunion_plan(PlannerInfo *root, RecursiveUnionPath *best_path)
635635 best_path->distinctList,
636636 numGroups);
637637
@@ -640,7 +640,7 @@ index 83e8b34b1b..9e4e4b365b 100644
640640
641641 return plan;
642642 }
643- @@ -2567 ,7 +2569 ,7 @@ create_lockrows_plan(PlannerInfo *root, LockRowsPath *best_path,
643+ @@ -2568 ,7 +2570 ,7 @@ create_lockrows_plan(PlannerInfo *root, LockRowsPath *best_path,
644644
645645 plan = make_lockrows(subplan, best_path->rowMarks, best_path->epqParam);
646646
@@ -649,7 +649,7 @@ index 83e8b34b1b..9e4e4b365b 100644
649649
650650 return plan;
651651 }
652- @@ -2628 ,7 +2630 ,7 @@ create_modifytable_plan(PlannerInfo *root, ModifyTablePath *best_path)
652+ @@ -2629 ,7 +2631 ,7 @@ create_modifytable_plan(PlannerInfo *root, ModifyTablePath *best_path)
653653 best_path->onconflict,
654654 best_path->epqParam);
655655
@@ -658,7 +658,7 @@ index 83e8b34b1b..9e4e4b365b 100644
658658
659659 return plan;
660660 }
661- @@ -2652 ,7 +2654 ,7 @@ create_limit_plan(PlannerInfo *root, LimitPath *best_path, int flags)
661+ @@ -2653 ,7 +2655 ,7 @@ create_limit_plan(PlannerInfo *root, LimitPath *best_path, int flags)
662662 best_path->limitOffset,
663663 best_path->limitCount);
664664
@@ -667,7 +667,7 @@ index 83e8b34b1b..9e4e4b365b 100644
667667
668668 return plan;
669669 }
670- @@ -2698 ,7 +2700 ,7 @@ create_seqscan_plan(PlannerInfo *root, Path *best_path,
670+ @@ -2699 ,7 +2701 ,7 @@ create_seqscan_plan(PlannerInfo *root, Path *best_path,
671671 scan_clauses,
672672 scan_relid);
673673
@@ -676,7 +676,7 @@ index 83e8b34b1b..9e4e4b365b 100644
676676
677677 return scan_plan;
678678 }
679- @@ -2744 ,7 +2746 ,7 @@ create_samplescan_plan(PlannerInfo *root, Path *best_path,
679+ @@ -2745 ,7 +2747 ,7 @@ create_samplescan_plan(PlannerInfo *root, Path *best_path,
680680 scan_relid,
681681 tsc);
682682
@@ -685,7 +685,7 @@ index 83e8b34b1b..9e4e4b365b 100644
685685
686686 return scan_plan;
687687 }
688- @@ -2922 ,7 +2924 ,7 @@ create_indexscan_plan(PlannerInfo *root,
688+ @@ -2923 ,7 +2925 ,7 @@ create_indexscan_plan(PlannerInfo *root,
689689 indexorderbyops,
690690 best_path->indexscandir);
691691
@@ -694,7 +694,7 @@ index 83e8b34b1b..9e4e4b365b 100644
694694
695695 return scan_plan;
696696 }
697- @@ -3037 ,7 +3039 ,7 @@ create_bitmap_scan_plan(PlannerInfo *root,
697+ @@ -3038 ,7 +3040 ,7 @@ create_bitmap_scan_plan(PlannerInfo *root,
698698 bitmapqualorig,
699699 baserelid);
700700
@@ -703,7 +703,7 @@ index 83e8b34b1b..9e4e4b365b 100644
703703
704704 return scan_plan;
705705 }
706- @@ -3357 ,7 +3359 ,7 @@ create_tidscan_plan(PlannerInfo *root, TidPath *best_path,
706+ @@ -3358 ,7 +3360 ,7 @@ create_tidscan_plan(PlannerInfo *root, TidPath *best_path,
707707 scan_relid,
708708 tidquals);
709709
@@ -712,7 +712,7 @@ index 83e8b34b1b..9e4e4b365b 100644
712712
713713 return scan_plan;
714714 }
715- @@ -3407 ,7 +3409 ,7 @@ create_subqueryscan_plan(PlannerInfo *root, SubqueryScanPath *best_path,
715+ @@ -3408 ,7 +3410 ,7 @@ create_subqueryscan_plan(PlannerInfo *root, SubqueryScanPath *best_path,
716716 scan_relid,
717717 subplan);
718718
@@ -721,7 +721,7 @@ index 83e8b34b1b..9e4e4b365b 100644
721721
722722 return scan_plan;
723723 }
724- @@ -3450 ,7 +3452 ,7 @@ create_functionscan_plan(PlannerInfo *root, Path *best_path,
724+ @@ -3451 ,7 +3453 ,7 @@ create_functionscan_plan(PlannerInfo *root, Path *best_path,
725725 scan_plan = make_functionscan(tlist, scan_clauses, scan_relid,
726726 functions, rte->funcordinality);
727727
@@ -730,7 +730,7 @@ index 83e8b34b1b..9e4e4b365b 100644
730730
731731 return scan_plan;
732732 }
733- @@ -3493 ,7 +3495 ,7 @@ create_tablefuncscan_plan(PlannerInfo *root, Path *best_path,
733+ @@ -3494 ,7 +3496 ,7 @@ create_tablefuncscan_plan(PlannerInfo *root, Path *best_path,
734734 scan_plan = make_tablefuncscan(tlist, scan_clauses, scan_relid,
735735 tablefunc);
736736
@@ -739,7 +739,7 @@ index 83e8b34b1b..9e4e4b365b 100644
739739
740740 return scan_plan;
741741 }
742- @@ -3537 ,7 +3539 ,7 @@ create_valuesscan_plan(PlannerInfo *root, Path *best_path,
742+ @@ -3538 ,7 +3540 ,7 @@ create_valuesscan_plan(PlannerInfo *root, Path *best_path,
743743 scan_plan = make_valuesscan(tlist, scan_clauses, scan_relid,
744744 values_lists);
745745
@@ -748,7 +748,7 @@ index 83e8b34b1b..9e4e4b365b 100644
748748
749749 return scan_plan;
750750 }
751- @@ -3630 ,7 +3632 ,7 @@ create_ctescan_plan(PlannerInfo *root, Path *best_path,
751+ @@ -3631 ,7 +3633 ,7 @@ create_ctescan_plan(PlannerInfo *root, Path *best_path,
752752 scan_plan = make_ctescan(tlist, scan_clauses, scan_relid,
753753 plan_id, cte_param_id);
754754
@@ -757,7 +757,7 @@ index 83e8b34b1b..9e4e4b365b 100644
757757
758758 return scan_plan;
759759 }
760- @@ -3669 ,7 +3671 ,7 @@ create_namedtuplestorescan_plan(PlannerInfo *root, Path *best_path,
760+ @@ -3670 ,7 +3672 ,7 @@ create_namedtuplestorescan_plan(PlannerInfo *root, Path *best_path,
761761 scan_plan = make_namedtuplestorescan(tlist, scan_clauses, scan_relid,
762762 rte->enrname);
763763
@@ -766,7 +766,7 @@ index 83e8b34b1b..9e4e4b365b 100644
766766
767767 return scan_plan;
768768 }
769- @@ -3707 ,7 +3709 ,7 @@ create_resultscan_plan(PlannerInfo *root, Path *best_path,
769+ @@ -3708 ,7 +3710 ,7 @@ create_resultscan_plan(PlannerInfo *root, Path *best_path,
770770
771771 scan_plan = make_result(tlist, (Node *) scan_clauses, NULL);
772772
@@ -775,7 +775,7 @@ index 83e8b34b1b..9e4e4b365b 100644
775775
776776 return scan_plan;
777777 }
778- @@ -3767 ,7 +3769 ,7 @@ create_worktablescan_plan(PlannerInfo *root, Path *best_path,
778+ @@ -3768 ,7 +3770 ,7 @@ create_worktablescan_plan(PlannerInfo *root, Path *best_path,
779779 scan_plan = make_worktablescan(tlist, scan_clauses, scan_relid,
780780 cteroot->wt_param_id);
781781
@@ -784,7 +784,7 @@ index 83e8b34b1b..9e4e4b365b 100644
784784
785785 return scan_plan;
786786 }
787- @@ -3827 ,7 +3829 ,7 @@ create_foreignscan_plan(PlannerInfo *root, ForeignPath *best_path,
787+ @@ -3828 ,7 +3830 ,7 @@ create_foreignscan_plan(PlannerInfo *root, ForeignPath *best_path,
788788 outer_plan);
789789
790790 /* Copy cost data from Path to Plan; no need to make FDW do this */
@@ -793,7 +793,7 @@ index 83e8b34b1b..9e4e4b365b 100644
793793
794794 /* Copy foreign server OID; likewise, no need to make FDW do this */
795795 scan_plan->fs_server = rel->serverid;
796- @@ -3961 ,7 +3963 ,7 @@ create_customscan_plan(PlannerInfo *root, CustomPath *best_path,
796+ @@ -3962 ,7 +3964 ,7 @@ create_customscan_plan(PlannerInfo *root, CustomPath *best_path,
797797 * Copy cost data from Path to Plan; no need to make custom-plan providers
798798 * do this
799799 */
@@ -802,7 +802,7 @@ index 83e8b34b1b..9e4e4b365b 100644
802802
803803 /* Likewise, copy the relids that are represented by this custom scan */
804804 cplan->custom_relids = best_path->path.parent->relids;
805- @@ -4063 ,7 +4065 ,7 @@ create_nestloop_plan(PlannerInfo *root,
805+ @@ -4064 ,7 +4066 ,7 @@ create_nestloop_plan(PlannerInfo *root,
806806 best_path->jointype,
807807 best_path->inner_unique);
808808
@@ -811,7 +811,7 @@ index 83e8b34b1b..9e4e4b365b 100644
811811
812812 return join_plan;
813813 }
814- @@ -4370 ,7 +4372 ,7 @@ create_mergejoin_plan(PlannerInfo *root,
814+ @@ -4371 ,7 +4373 ,7 @@ create_mergejoin_plan(PlannerInfo *root,
815815 best_path->skip_mark_restore);
816816
817817 /* Costs of sort and material steps are included in path cost already */
@@ -820,7 +820,7 @@ index 83e8b34b1b..9e4e4b365b 100644
820820
821821 return join_plan;
822822 }
823- @@ -4543 ,7 +4545 ,7 @@ create_hashjoin_plan(PlannerInfo *root,
823+ @@ -4544 ,7 +4546 ,7 @@ create_hashjoin_plan(PlannerInfo *root,
824824 best_path->jpath.jointype,
825825 best_path->jpath.inner_unique);
826826
@@ -829,7 +829,7 @@ index 83e8b34b1b..9e4e4b365b 100644
829829
830830 return join_plan;
831831 }
832- @@ -5043 ,7 +5045 ,7 @@ order_qual_clauses(PlannerInfo *root, List *clauses)
832+ @@ -5044 ,7 +5046 ,7 @@ order_qual_clauses(PlannerInfo *root, List *clauses)
833833 * Also copy the parallel-related flags, which the executor *will* use.
834834 */
835835 static void
@@ -838,7 +838,7 @@ index 83e8b34b1b..9e4e4b365b 100644
838838 {
839839 dest->startup_cost = src->startup_cost;
840840 dest->total_cost = src->total_cost;
841- @@ -5051 ,6 +5053 ,9 @@ copy_generic_path_info(Plan *dest, Path *src)
841+ @@ -5052 ,6 +5054 ,9 @@ copy_generic_path_info(Plan *dest, Path *src)
842842 dest->plan_width = src->pathtarget->width;
843843 dest->parallel_aware = src->parallel_aware;
844844 dest->parallel_safe = src->parallel_safe;
@@ -907,7 +907,7 @@ index f8b79ec120..f970971a4a 100644
907907 extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt, const char *queryString,
908908 ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest);
909909diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
910- index5de52edda4..2ec34b2b11 100644
910+ indexb6d4b0eda0..3d630c7139 100644
911911--- a/src/include/nodes/pathnodes.h
912912+++ b/src/include/nodes/pathnodes.h
913913@@ -710,6 +710,10 @@ typedef struct RelOptInfo
@@ -1073,3 +1073,19 @@ index 80dc4bf4e8..afb9e9454e 100644
10731073 /*
10741074 * prototypes for plan/planmain.c
10751075 */
1076+ diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
1077+ index 131a4c76c4..a836764110 100644
1078+ --- a/src/tools/msvc/Mkvcbuild.pm
1079+ +++ b/src/tools/msvc/Mkvcbuild.pm
1080+ @@ -36,7 +36,10 @@ my @contrib_uselibpq = ('dblink', 'oid2name', 'postgres_fdw', 'vacuumlo');
1081+ my @contrib_uselibpgport = ('oid2name', 'pg_standby', 'vacuumlo');
1082+ my @contrib_uselibpgcommon = ('oid2name', 'pg_standby', 'vacuumlo');
1083+ my $contrib_extralibs = undef;
1084+ - my $contrib_extraincludes = { 'dblink' => ['src/backend'] };
1085+ + my $contrib_extraincludes = {
1086+ + 'aqo' => ['contrib/postgres_fdw'],
1087+ + 'dblink' => ['src/backend']
1088+ + };
1089+ my $contrib_extrasource = {
1090+ 'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ],
1091+ 'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ],