diff --git a/src/backend/distributed/planner/multi_router_planner.c b/src/backend/distributed/planner/multi_router_planner.c index d399045cd..e4bd09cd8 100644 --- a/src/backend/distributed/planner/multi_router_planner.c +++ b/src/backend/distributed/planner/multi_router_planner.c @@ -615,7 +615,16 @@ ModifyQuerySupported(Query *queryTree, Query *originalQuery, bool multiShardQuer if (cteQuery->hasForUpdate) { return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED, - "Router planner doesn't support SELECT FOR UPDATE in common table expressions.", + "Router planner doesn't support SELECT FOR UPDATE" + " in common table expressions.", + NULL, NULL); + } + + if (FindNodeCheck((Node *) cteQuery, CitusIsVolatileFunction)) + { + return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED, + "Router planner doesn't support VOLATILE functions" + " in common table expressions.", NULL, NULL); }