diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-03-08 15:00:50 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-03-08 15:00:50 +0900 |
commit | daa8365a900729fe2a8d427fbeff19e763e35723 (patch) | |
tree | 3e792990565728f99f736948e50692888c455210 /contrib/pg_stat_statements/pg_stat_statements.c | |
parent | be504a3e974d75be6f95c8f9b7367126034f2d12 (diff) | |
download | postgresql-daa8365a900729fe2a8d427fbeff19e763e35723.tar.gz postgresql-daa8365a900729fe2a8d427fbeff19e763e35723.zip |
Reflect normalization of query strings for utilities in pg_stat_statements
Applying normalization changes how the following query strings are
reflected in pg_stat_statements, by showing Const nodes with a
dollar-signed parameter as this is how such queries are structured
internally once parsed:
- DECLARE
- EXPLAIN
- CREATE MATERIALIZED VIEW
- CREATE TABLE AS
More normalization could be done in the future depending on the parts
where query jumbling is applied (like A_Const nodes?), the changes being
reflected in the regression tests in majority created in de2aca2. This
just allows the basics to work for utility queries using Const nodes.
Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/Y+MRdEq9W9XVa2AB@paquier.xyz
Diffstat (limited to 'contrib/pg_stat_statements/pg_stat_statements.c')
-rw-r--r-- | contrib/pg_stat_statements/pg_stat_statements.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index ad1fe444969..5285c3f7faa 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -836,8 +836,10 @@ pgss_post_parse_analyze(ParseState *pstate, Query *query, JumbleState *jstate) if (query->utilityStmt) { if (pgss_track_utility && !PGSS_HANDLED_UTILITY(query->utilityStmt)) + { query->queryId = UINT64CONST(0); - return; + return; + } } /* |