88 * ------------------------------------------------------------------------
99 */
1010
11+ #include "copy_stmt_hooking.h"
1112#include "hooks.h"
1213#include "init.h"
1314#include "partition_filter.h"
@@ -27,6 +28,7 @@ set_rel_pathlist_hook_type set_rel_pathlist_hook_next = NULL;
2728planner_hook_type planner_hook_next = NULL ;
2829post_parse_analyze_hook_type post_parse_analyze_hook_next = NULL ;
2930shmem_startup_hook_type shmem_startup_hook_next = NULL ;
31+ ProcessUtility_hook_type process_utility_hook_next = NULL ;
3032
3133
3234/* Take care of joins */
@@ -574,3 +576,32 @@ pathman_relcache_hook(Datum arg, Oid relid)
574576 break ;
575577 }
576578}
579+
580+ /*
581+ * Utility function invoker hook.
582+ */
583+ void
584+ pathman_process_utility_hook (Node * parsetree ,
585+ const char * queryString ,
586+ ProcessUtilityContext context ,
587+ ParamListInfo params ,
588+ DestReceiver * dest ,
589+ char * completionTag )
590+ {
591+ /* Call hooks set by other extensions */
592+ if (process_utility_hook_next )
593+ process_utility_hook_next (parsetree , queryString ,
594+ context , params ,
595+ dest , completionTag );
596+
597+ /* Override standard COPY statements if needed */
598+ if (is_pathman_related_copy (parsetree ))
599+ {
600+ elog (INFO , "copy!" );
601+ }
602+
603+ /* Call internal implementation */
604+ standard_ProcessUtility (parsetree , queryString ,
605+ context , params ,
606+ dest , completionTag );
607+ }
0 commit comments