Re: pg_stat_statements: add missing tests for nesting_level

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_stat_statements: add missing tests for nesting_level
Date: 2026-01-21 00:41:59
Message-ID: aXAg1zOSQmmdhazO@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 20, 2026 at 06:08:14PM -0600, Sami Imseih wrote:
> While looking at pg_stat_statements nesting_level, I realized that there
> are missing nesting_level tests for pgss_planner and pgss_ExecutorFinish.
> That is, if you remove nesting_level++ and nesting_level-- in those 2 hooks,
> the tests will still succeed.
>
> For pgss_planner the nesting_level updates missing tests are the ones
> when track_planning is enabled.
>
> Attached is a quick patch to add coverage.

Confirmed these two deficiencies, nice catch. If one does the same
removal of the nesting level calculation in other code paths like
pgss_ExecutorRun(), one get complaints. Will see to get this addition
done.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2026-01-21 01:09:25 Re: docs: clarify ALTER TABLE behavior on partitioned tables
Previous Message Sami Imseih 2026-01-21 00:23:21 Re: pg_stat_statements: Fix nested tracking for implicitly closed cursors