Re: pg_stat_statements: add missing tests for nesting_level

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-29T01:25:13Z
Lists: pgsql-hackers
On Sun, Jan 25, 2026 at 04:41:22PM +0900, Michael Paquier wrote:
> Reproduced here.  That was trickier than it looks.  A trick with
> debug_discard_caches cannot help, because with a CLOBBER_CACHE_ALWAYS
> build we would still do a GetCachedPlan() -> RevalidateCachedQuery()
> that goes through the post-parse analyze hook where the query would
> still be normalized, showing up in the output anyway.

It took a couple of days, but avocet has reported back green today:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=avocet&dt=2026-01-28%2001%3A10%3A18

It means that we should be good now.
--
Michael

Commits

  1. pg_stat_statements: Fix test instability with cache-clobbering builds

  2. pg_stat_statements: Add more tests for level tracking