@@ -3964,7 +3964,9 @@ vops_expression_tree_mutator(Node *node, void *context)
3964
3964
}
3965
3965
3966
3966
static post_parse_analyze_hook_type post_parse_analyze_hook_next ;
3967
+ #if PG_VERSION_NUM < 140000
3967
3968
static ExplainOneQuery_hook_type save_explain_hook ;
3969
+ #endif
3968
3970
3969
3971
3970
3972
typedef enum
@@ -4458,6 +4460,7 @@ vops_substitute_tables_with_projections(char const* queryString, Query *query)
4458
4460
{
4459
4461
ExplainStmt * explain = (ExplainStmt * )parsetree -> stmt ;
4460
4462
select = (SelectStmt * )explain -> query ;
4463
+ parsetree -> stmt = (Node * )select ;
4461
4464
}
4462
4465
else
4463
4466
#endif
@@ -4626,6 +4629,7 @@ static void vops_post_parse_analysis_hook(ParseState *pstate, Query *query)
4626
4629
}
4627
4630
}
4628
4631
4632
+ #if PG_VERSION_NUM < 140000
4629
4633
#if PG_VERSION_NUM >=110000
4630
4634
static void vops_explain_hook (Query * query ,
4631
4635
int cursorOptions ,
@@ -4701,6 +4705,7 @@ static void vops_explain_hook(Query *query,
4701
4705
#endif
4702
4706
);
4703
4707
}
4708
+ #endif
4704
4709
4705
4710
static void reset_static_cache (void )
4706
4711
{
@@ -4713,8 +4718,10 @@ void _PG_init(void)
4713
4718
elog (LOG , "Initialize VOPS extension" );
4714
4719
post_parse_analyze_hook_next = post_parse_analyze_hook ;
4715
4720
post_parse_analyze_hook = vops_post_parse_analysis_hook ;
4721
+ #if PG_VERSION_NUM < 140000
4716
4722
save_explain_hook = ExplainOneQuery_hook ;
4717
4723
ExplainOneQuery_hook = vops_explain_hook ;
4724
+ #endif
4718
4725
DefineCustomBoolVariable ("vops.auto_substitute_projections" ,
4719
4726
"Automatically substitute tables with thier projections" ,
4720
4727
NULL ,
@@ -4732,7 +4739,9 @@ void _PG_fini(void)
4732
4739
elog (LOG , "Finalize VOPS extension" );
4733
4740
/* Restore hooks */
4734
4741
post_parse_analyze_hook = post_parse_analyze_hook_next ;
4742
+ #if PG_VERSION_NUM < 140000
4735
4743
ExplainOneQuery_hook = save_explain_hook ;
4744
+ #endif
4736
4745
4737
4746
/* undo static initializations */
4738
4747
reset_static_cache ();
0 commit comments