git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: cd85ae1) | patch
Propagate query IDs of utility statements in functions
2024年7月19日 01:21:01 +0000 (10:21 +0900)
2024年7月19日 01:21:01 +0000 (10:21 +0900)
commit c145f321b681ab6c3636849071ff30d5c6f6353c
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
(3db72ebcbe20), 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
contrib/pg_stat_statements/expected/level_tracking.out diff | blob | blame | history
contrib/pg_stat_statements/sql/level_tracking.sql diff | blob | blame | history
src/backend/executor/functions.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /