diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index d6aafe37483..a2f2e2049a2 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -54,7 +54,7 @@ #include "jit/jit.h" #include "mb/pg_wchar.h" #include "miscadmin.h" -#include "parser/parser.h" +#include "parser/parser.h" #include "parser/parsetree.h" #include "storage/bufmgr.h" #include "storage/lmgr.h" @@ -818,9 +818,10 @@ InitPlan(QueryDesc *queryDesc, int eflags) int i; /* - * Do permissions checks + * Do permissions checks if not parallel worker */ - ExecCheckRTPerms(rangeTable, true); + if (!(sql_dialect == SQL_DIALECT_TSQL && IsParallelWorker())) + ExecCheckRTPerms(rangeTable, true); /* * initialize the node's execution state