Correctly propagate queryId for utility stmt in function
Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
From: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-07-18T11:37:40Z
Lists: pgsql-hackers
Attachments
- v1-0001-Correctly-propagate-queryId-for-utility-stmt-in-f.patch (application/x-patch) patch v1-0001
Hi, For utility statements defined within a function, the queryTree is copied to a plannedStmt as utility commands don't require planning. However, the queryId is not propagated to the plannedStmt. This leads to plugins relying on queryId like pg_stat_statements to not be able to track utility statements within function calls. This patch fixes the issue by correctly propagating queryId from the cached queryTree to the plannedStmt. Regards, Anthonin
Commits
-
Propagate query IDs of utility statements in functions
- 9cd365f28f31 16.4 landed
- 38e271d3c2e8 17.0 landed
- c145f321b681 18.0 landed