Subject: Re: query ID goes missing with extended query protocol

From: Michael Paquier <[email-masked]>
Date: Thu, 29 Aug 2024 07:48:07 +0900

On Wed, Aug 28, 2024 at 04:27:38PM -0400, Robert Haas wrote:
> - Add a call to
> pgstat_report_query_id(queryDesc->plannedstmt->queryId, false) to the
> top of ExecutorRun() with an appropriate comment.
> - Fix the incorrect comment mentioned above.
> - Back-patch to all releases containing 4f0b0966c86 i.e. v14+.

This is being discussed already on a different thread:
- Thread: https://www.postgresql.org/message-id/[email-masked]
- CF entry: https://commitfest.postgresql.org/49/4963/

There is a patch proposed there, that attempts to deal with the two
cases of a portal where ExecutorRun() is called once while holding a
tuplestore and where ExecutorRun() is called multiple times.  A few
approaches have been discussed for the tests, where the new psql
metacommands added in d55322b0da60 should become handy.  That's on my
TODO spreadsheet of things to look at, but I did not come back to it
yet.

A backpatch would be adapted for that, yep.  I'd like to see tests on
HEAD at least.
--
Michael