pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add some sanity checks in executor for query ID reporting
Date: Wed, 18 Sep 2024 05:46:17 +0000
Message-ID: <E1sqnW5-001bjd-DA@gemulon.postgresql.org> (raw)

Add some sanity checks in executor for query ID reporting

This commit adds three sanity checks in code paths of the executor where
it is possible to use hooks, checking that a query ID is reported in
pg_stat_activity if compute_query_id is enabled:
- ExecutorRun()
- ExecutorFinish()
- ExecutorEnd()

This causes the test in pg_stat_statements added in 933848d16dc9 to
complain immediately in ExecutorRun().  The idea behind this commit is
to help extensions to detect if they are missing query ID reports when a
query goes through the executor.  Perhaps this will prove to be a bad
idea, but let's see where this experience goes in v18 and newer
versions.

Reviewed-by: Sami Imseih
Discussion: https://postgr.es/m/ZuJb5xCKHH0A9tMN@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/24f5205948093a96edf8213294b3d585ac3fe1fb

Modified Files
--------------
src/backend/executor/execMain.c | 10 ++++++++++
1 file changed, 10 insertions(+)



Message-ID: <E1sqnW5-001bjd-DA@gemulon.postgresql.org>
Permalink:  ../E1sqnW5-001bjd-DA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sqnW5-001bjd-DA@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add some sanity checks in executor for query ID reporting
  In-Reply-To: <E1sqnW5-001bjd-DA@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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