diff options
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r-- | src/backend/executor/execMain.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 78ddbf95f68..b2e2df87733 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -58,6 +58,7 @@ #include "storage/lmgr.h" #include "tcop/utility.h" #include "utils/acl.h" +#include "utils/backend_status.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/partcache.h" @@ -128,6 +129,14 @@ static void EvalPlanQualStart(EPQState *epqstate, Plan *planTree); void ExecutorStart(QueryDesc *queryDesc, int eflags) { + /* + * In some cases (e.g. an EXECUTE statement) a query execution will skip + * parse analysis, which means that the queryid won't be reported. Note + * that it's harmless to report the queryid multiple time, as the call will + * be ignored if the top level queryid has already been reported. + */ + pgstat_report_queryid(queryDesc->plannedstmt->queryId, false); + if (ExecutorStart_hook) (*ExecutorStart_hook) (queryDesc, eflags); else |