@@ -3964,7 +3964,9 @@ vops_expression_tree_mutator(Node *node, void *context)
39643964}
39653965
39663966static post_parse_analyze_hook_type post_parse_analyze_hook_next ;
3967+ #if PG_VERSION_NUM < 140000
39673968static ExplainOneQuery_hook_type save_explain_hook ;
3969+ #endif
39683970
39693971
39703972typedef enum
@@ -4458,6 +4460,7 @@ vops_substitute_tables_with_projections(char const* queryString, Query *query)
44584460 {
44594461 ExplainStmt * explain = (ExplainStmt * )parsetree -> stmt ;
44604462 select = (SelectStmt * )explain -> query ;
4463+ parsetree -> stmt = (Node * )select ;
44614464 }
44624465 else
44634466#endif
@@ -4626,6 +4629,7 @@ static void vops_post_parse_analysis_hook(ParseState *pstate, Query *query)
46264629 }
46274630}
46284631
4632+ #if PG_VERSION_NUM < 140000
46294633#if PG_VERSION_NUM >=110000
46304634static void vops_explain_hook (Query * query ,
46314635 int cursorOptions ,
@@ -4701,6 +4705,7 @@ static void vops_explain_hook(Query *query,
47014705#endif
47024706 );
47034707}
4708+ #endif
47044709
47054710static void reset_static_cache (void )
47064711{
@@ -4713,8 +4718,10 @@ void _PG_init(void)
47134718 elog (LOG , "Initialize VOPS extension" );
47144719 post_parse_analyze_hook_next = post_parse_analyze_hook ;
47154720 post_parse_analyze_hook = vops_post_parse_analysis_hook ;
4721+ #if PG_VERSION_NUM < 140000
47164722 save_explain_hook = ExplainOneQuery_hook ;
47174723 ExplainOneQuery_hook = vops_explain_hook ;
4724+ #endif
47184725 DefineCustomBoolVariable ("vops.auto_substitute_projections" ,
47194726 "Automatically substitute tables with thier projections" ,
47204727 NULL ,
@@ -4732,7 +4739,9 @@ void _PG_fini(void)
47324739 elog (LOG , "Finalize VOPS extension" );
47334740 /* Restore hooks */
47344741 post_parse_analyze_hook = post_parse_analyze_hook_next ;
4742+ #if PG_VERSION_NUM < 140000
47354743 ExplainOneQuery_hook = save_explain_hook ;
4744+ #endif
47364745
47374746 /* undo static initializations */
47384747 reset_static_cache ();
0 commit comments