1
1
diff --git a/contrib/Makefile b/contrib/Makefile
2
- index bbf220407b..8c3dc186ef 100644
2
+ index bbf220407b0..8c3dc186efa 100644
3
3
--- a/contrib/Makefile
4
4
+++ b/contrib/Makefile
5
10000
5
@@ -7,6 +7,7 @@ include $(top_builddir)/src/Makefile.global
@@ -11,7 +11,7 @@ index bbf220407b..8c3dc186ef 100644
11
11
auto_explain \
12
12
basic_archive \
13
13
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
14
- index 060c6186dd..742a0a3e84 100644
14
+ index 060c6186ddd..742a0a3e844 100644
15
15
--- a/src/backend/commands/explain.c
16
16
+++ b/src/backend/commands/explain.c
17
17
@@ -24,6 +24,7 @@
@@ -56,8 +56,31 @@ index 060c6186dd..742a0a3e84 100644
56
56
/* in text format, first line ends here */
57
57
if (es->format == EXPLAIN_FORMAT_TEXT)
58
58
appendStringInfoChar(es->str, '\n');
59
+ diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
60
+ index 3f750d34b36..29fbf1796e7 100644
61
+ --- a/src/backend/commands/extension.c
62
+ +++ b/src/backend/commands/extension.c
63
+ @@ -66,6 +66,8 @@
64
+ #include "utils/snapmgr.h"
65
+ #include "utils/varlena.h"
66
+
67
+ + /* Hook for plugins to get control in CreateExtension() */
68
+ + CreateExtension_hook_type CreateExtension_hook = NULL;
69
+
70
+ /* Globally visible state variables */
71
+ bool creating_extension = false;
72
+ @@ -1768,6 +1770,9 @@ CreateExtension(ParseState *pstate, CreateExtensionStmt *stmt)
73
+ elog(ERROR, "unrecognized option: %s", defel->defname);
74
+ }
75
+
76
+ + if (CreateExtension_hook)
77
+ + CreateExtension_hook(stmt->extname);
78
+ +
79
+ /* Call CreateExtensionInternal to do the real work. */
80
+ return CreateExtensionInternal(stmt->extname,
81
+ schemaName,
59
82
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
60
- index b39b77050e..f6262419e9 100644
83
+ index b39b77050e0..f6262419e92 100644
61
84
--- a/src/backend/nodes/copyfuncs.c
62
85
+++ b/src/backend/nodes/copyfuncs.c
63
86
@@ -136,6 +136,7 @@ CopyPlanFields(const Plan *from, Plan *newnode)
@@ -69,7 +92,7 @@ index b39b77050e..f6262419e9 100644
69
92
70
93
/*
71
94
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
72
- index 3f8e58626c..256c76acf2 100644
95
+ index 3f8e58626cc..256c76acf29 100644
73
96
--- a/src/backend/nodes/outfuncs.c
74
97
+++ b/src/backend/nodes/outfuncs.c
75
98
@@ -356,6 +356,7 @@ _outPlanInfo(StringInfo str, const Plan *node)
@@ -81,7 +104,7 @@ index 3f8e58626c..256c76acf2 100644
81
104
82
105
/*
83
106
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
84
- index c84e5af3a2..ae0e78b142 100644
107
+ index c84e5af3a26..ae0e78b1424 100644
85
108
--- a/src/backend/nodes/readfuncs.c
86
109
+++ b/src/backend/nodes/readfuncs.c
87
110
@@ -1666,6 +1666,11 @@ ReadCommonPlan(Plan *local_node)
@@ -97,7 +120,7 @@ index c84e5af3a2..ae0e78b142 100644
97
120
98
121
/*
99
122
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
100
- index 0ba26b207b..7baf41539e 100644
123
+ index 0ba26b207b0..7baf41539e1 100644
101
124
--- a/src/backend/optimizer/path/costsize.c
102
125
+++ b/src/backend/optimizer/path/costsize.c
103
126
@@ -99,6 +99,11 @@
@@ -362,7 +385,7 @@ index 0ba26b207b..7baf41539e 100644
362
385
{
363
386
double parallel_divisor = path->parallel_workers;
364
387
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
365
- index 1bc59c9457..81cf03514d 100644
388
+ index 1bc59c94578..81cf03514d3 100644
366
389
--- a/src/backend/optimizer/plan/createplan.c
367
390
+++ b/src/backend/optimizer/plan/createplan.c
368
391
@@ -70,6 +70,7 @@
@@ -393,7 +416,7 @@ index 1bc59c9457..81cf03514d 100644
393
416
394
417
/*
395
418
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
396
- index 468105d91e..63822050ff 100644
419
+ index c588693dc43..1ad88d77ce5 100644
397
420
--- a/src/backend/optimizer/plan/planner.c
398
421
+++ b/src/backend/optimizer/plan/planner.c
399
422
@@ -143,7 +143,8 @@ static List *extract_rollup_sets(List *groupingSets);
@@ -406,7 +429,7 @@ index 468105d91e..63822050ff 100644
406
429
grouping_sets_data *gd,
407
430
List *target_list);
408
431
static RelOptInfo *create_grouping_paths(PlannerInfo *root,
409
- @@ -3220 ,7 +3221 ,8 @@ standard_qp_callback(PlannerInfo *root, void *extra)
432
+ @@ -3221 ,7 +3222 ,8 @@ standard_qp_callback(PlannerInfo *root, void *extra)
410
433
*/
411
434
static double
412
435
get_number_of_groups(PlannerInfo *root,
@@ -416,7 +439,7 @@ index 468105d91e..63822050ff 100644
416
439
grouping_sets_data *gd,
417
440
List *target_list)
418
441
{
419
- @@ -3257 ,7 +3259 ,7 @@ get_number_of_groups(PlannerInfo *root,
442
+ @@ -3258 ,7 +3260 ,7 @@ get_number_of_groups(PlannerInfo *root,
420
443
GroupingSetData *gs = lfirst_node(GroupingSetData, lc2);
421
444
double numGroups = estimate_num_groups(root,
422
445
groupExprs,
@@ -425,7 +448,7 @@ index 468105d91e..63822050ff 100644
425
448
&gset,
426
449
NULL);
427
450
428
- @@ -3283 ,7 +3285 ,7 @@ get_number_of_groups(PlannerInfo *root,
451
+ @@ -3284 ,7 +3286 ,7 @@ get_number_of_groups(PlannerInfo *root,
429
452
GroupingSetData *gs = lfirst_node(GroupingSetData, lc2);
430
453
double numGroups = estimate_num_groups(root,
431
454
groupExprs,
@@ -434,7 +457,7 @@ index 468105d91e..63822050ff 100644
434
457
&gset,
435
458
NULL);
436
459
437
- @@ -3300 ,8 +3302 ,8 @@ get_number_of_groups(PlannerInfo *root,
460
+ @@ -3301 ,8 +3303 ,8 @@ get_number_of_groups(PlannerInfo *root,
438
461
groupExprs = get_sortgrouplist_exprs(parse->groupClause,
439
462
target_list);
440
463
@@ -445,7 +468,7 @@ index 468105d91e..63822050ff 100644
445
468
}
446
469
}
447
470
else if (parse->groupingSets)
448
- @@ -3688 ,7 +3690 ,8 @@ create_ordinary_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel,
471
+ @@ -3689 ,7 +3691 ,8 @@ create_ordinary_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel,
449
472
* Estimate number of groups.
450
473
*/
451
474
dNumGroups = get_number_of_groups(root,
@@ -455,7 +478,7 @@ index 468105d91e..63822050ff 100644
455
478
gd,
456
479
extra->targetList);
457
480
458
- @@ -6653 ,13 +6656 ,15 @@ create_partial_grouping_paths(PlannerInfo *root,
481
+ @@ -6654 ,13 +6657 ,15 @@ create_partial_grouping_paths(PlannerInfo *root,
459
482
if (cheapest_total_path != NULL)
460
483
dNumPartialGroups =
461
484
get_number_of_groups(root,
@@ -474,7 +497,7 @@ index 468105d91e..63822050ff 100644
474
497
extra->targetList);
475
498
476
499
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
477
- index 520409f4ba..fd0524d72b 100644
500
+ index 3c75fd56f22..f15d22c41be 100644
478
501
--- a/src/backend/optimizer/util/relnode.c
479
502
+++ b/src/backend/optimizer/util/relnode.c
480
503
@@ -259,6 +259,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
@@ -540,7 +563,7 @@ index 520409f4ba..fd0524d72b 100644
540
563
541
564
return ppi;
542
565
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
543
- index 8d1b374bdf..ac4ea7b6e4 100644
566
+ index 2dd399d5e37..53178369c70 100644
544
567
--- a/src/backend/utils/adt/selfuncs.c
545
568
+++ b/src/backend/utils/adt/selfuncs.c
546
569
@@ -143,6 +143,7 @@
@@ -573,7 +596,7 @@ index 8d1b374bdf..ac4ea7b6e4 100644
573
596
* estimate_num_groups - Estimate number of groups in a grouped query
574
597
*
575
598
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h
576
- index 666977fb1f..33b109afbb 100644
599
+ index 666977fb1f8..33b109afbbd 100644
577
600
--- a/src/include/commands/explain.h
578
601
+++ b/src/include/commands/explain.h
579
602
@@ -75,6 +75,18 @@ extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
@@ -595,8 +618,22 @@ index 666977fb1f..33b109afbb 100644
595
618
596
619
extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
597
620
ParamListInfo params, DestReceiver *dest);
621
+ diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h
622
+ index e24e3759f0c..2f98d8cb323 100644
623
+ --- a/src/include/commands/extension.h
624
+ +++ b/src/include/commands/extension.h
625
+ @@ -30,6 +30,9 @@
626
+ extern PGDLLIMPORT bool creating_extension;
627
+ extern PGDLLIMPORT Oid CurrentExtensionObject;
628
+
629
+ + typedef void (*CreateExtension_hook_type) (char *extname);
630
+ + extern PGDLLIMPORT CreateExtension_hook_type CreateExtension_hook;
631
+ +
632
+
633
+ extern ObjectAddress CreateExtension(ParseState *pstate, CreateExtensionStmt *stmt);
634
+
598
635
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
599
- index 8556b2ffe7..48b191e426 100644
636
+ index cbaefd9f043..06d8bac7d16 100644
600
637
--- a/src/include/nodes/pathnodes.h
601
638
+++ b/src/include/nodes/pathnodes.h
602
639
@@ -757,6 +757,10 @@ typedef struct RelOptInfo
@@ -637,7 +674,7 @@ index 8556b2ffe7..48b191e426 100644
637
674
638
675
639
676
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
640
- index 0ea9a22dfb..d084e4f8a0 100644
677
+ index 493a2a9e4a5..adb7f4134c4 100644
641
678
--- a/src/include/nodes/plannodes.h
642
679
+++ b/src/include/nodes/plannodes.h
643
680
@@ -159,6 +159,9 @@ typedef struct Plan
@@ -651,7 +688,7 @@ index 0ea9a22dfb..d084e4f8a0 100644
651
688
652
689
/* ----------------
653
690
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
654
- index bc12071af6..13fa62652f 100644
691
+ index bc12071af6e..13fa62652fa 100644
655
692
--- a/src/include/optimizer/cost.h
656
693
+++ b/src/include/optimizer/cost.h
657
694
@@ -41,6 +41,37 @@ typedef enum
@@ -735,7 +772,7 @@ index bc12071af6..13fa62652f 100644
735
772
736
773
#endif /* COST_H */
737
774
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h
738
- index d2d46b15df..88608af01d 100644
775
+ index d2d46b15df5..88608af01d7 100644
739
776
--- a/src/include/optimizer/pathnode.h
740
777
+++ b/src/include/optimizer/pathnode.h
741
778
@@ -18,6 +18,10 @@
@@ -750,7 +787,7 @@ index d2d46b15df..88608af01d 100644
750
787
* prototypes for pathnode.c
751
788
*/
752
789
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
753
- index c4f61c1a09..ade32a6f44 100644
790
+ index c4f61c1a09c..ade32a6f444 100644
754
791
--- a/src/include/optimizer/pla
2851
nmain.h
755
792
+++ b/src/include/optimizer/planmain.h
756
793
@@ -24,6 +24,12 @@ extern PGDLLIMPORT double cursor_tuple_fraction;
@@ -767,7 +804,7 @@ index c4f61c1a09..ade32a6f44 100644
767
804
* prototypes for plan/planmain.c
768
805
*/
769
806
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
770
- index 8f3d73edfb..91537e2325 100644
807
+ index 8f3d73edfb2..91537e23252 100644
771
808
--- a/src/include/utils/selfuncs.h
772
809
+++ b/src/include/utils/selfuncs.h
773
810
@@ -144,6 +144,13 @@ typedef bool (*get_index_stats_hook_type) (PlannerInfo *root,
0 commit comments