pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_stat_statements: Add more tests with temp tables and namespac
2+ messages / 1 participants
[nested] [flat]

* pgsql: pg_stat_statements: Add more tests with temp tables and namespac
@ 2025-03-25 22:34  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2025-03-25 22:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_stat_statements: Add more tests with temp tables and namespaces

These tests provide coverage for RangeTblEntry and how query jumbling
works with search_path, as well as the case where relations are
re-created, generating a different query ID as the relation OID is used
in the computation.

A patch is under discussion to switch to a different approach based on
the relation name, and there was no test coverage for this area,
including how queries are currently grouped with search_path.  This is
useful to track how the situation changes between HEAD and any patches
proposed.

Christoph has proposed the test with ON COMMIT DROP temporary tables,
and I have written the second part.

Author: Christoph Berg <myon@debian.org>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/Z9iWXKGwkm8RAC93@msg.df7cb.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3430215fe35f96e4be355c93e275f00656800602

Modified Files
--------------
contrib/pg_stat_statements/expected/select.out | 240 +++++++++++++++++++++++++
contrib/pg_stat_statements/sql/select.sql      |  69 +++++++
2 files changed, 309 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: pg_stat_statements: Add more tests for level tracking
@ 2026-01-21 09:19  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2026-01-21 09:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_stat_statements: Add more tests for level tracking

This commit adds tests to verify the computation of the nesting level
for two code paths: the planner hook and the ExecutorFinish() hook.  The
nesting level is essential to save a correct "toplevel" status for the
added PGSS entries.

The author has noticed that removing the manipulations of nesting_level
in these two code paths did not cause the tests to complain, meaning
that we never had coverage for the assumptions taken by the code.

Author: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/CAA5RZ0uK1PSrgf52bWCtDpzaqbWt04o6ZA7zBm6UQyv7vyvf9w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1572ea96e65731eee3227fbc3c119bd9f39e8e50

Modified Files
--------------
.../pg_stat_statements/expected/level_tracking.out | 66 ++++++++++++++++++++++
contrib/pg_stat_statements/sql/level_tracking.sql  | 38 +++++++++++++
2 files changed, 104 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-01-21 09:19 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-25 22:34 pgsql: pg_stat_statements: Add more tests with temp tables and namespac Michael Paquier <michael@paquier.xyz>
2026-01-21 09:19 pgsql: pg_stat_statements: Add more tests for level tracking Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox