postgresql/contrib/pg_stat_statements/sql
Michael Paquier 38e271d3c2 Propagate query IDs of utility statements in functions
For utility statements defined within a function, the query tree is
copied to a PlannedStmt as utility commands do not require planning.
However, the query ID was missing from the information passed down.

This leads to plugins relying on the query ID like pg_stat_statements to
not be able to track utility statements within function calls.  Tests
are added to check this behavior, depending on pg_stat_statements.track.

This is an old bug.  Now, query IDs for utilities are compiled using
their parsed trees rather than the query string since v16
(3db72ebcbe), leading to less bloat with utilities, so backpatch down
only to this version.

Author: Anthonin Bonnefoy
Discussion: https://postgr.es/m/CAO6_XqrGp-uwBqi3vBPLuRULKkddjC7R5QZCgsFren=8E+m2Sg@mail.gmail.com
Backpatch-through: 16
2024-07-19 10:21:21 +09:00
..
cleanup.sql Refactor tests of pg_stat_statements for planning, utility and level tracking 2023-02-20 09:28:29 +09:00
cursors.sql Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00
dml.sql Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00
entry_timestamp.sql Track statement entry timestamp in contrib/pg_stat_statements 2023-11-27 02:52:17 +02:00
level_tracking.sql Propagate query IDs of utility statements in functions 2024-07-19 10:21:21 +09:00
oldextversions.sql pg_stat_statements: Add test coverage for pg_stat_statements_reset_1_7 2023-12-27 10:48:01 +01:00
planning.sql Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00
select.sql Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00
user_activity.sql Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00
utility.sql Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00
wal.sql Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00