On Mon, Jun 02, 2025 at 02:44:36PM -0500, Sami Imseih wrote:
> Since the FETCH case is clear-cut, here is a patch that normalizes variable
> fetch sizes in a FETCH command. At a minimum, we can apply this patch.
> I’ve also added tests in pg_stat_statements utility.sql to demonstrate
> how queryIds
> are grouped for the variants of the FETCH statement.

 {
     NodeTag        type;
     FetchDirection direction;    /* see above */
-    long        howMany;        /* number of rows, or position argument */
+    /* number of rows, or position argument */
+    long        howMany pg_node_attr(query_jumble_ignore);
     char       *portalname;        /* name of portal (cursor) */
     bool        ismove;            /* true if MOVE */
+    ParseLoc    location pg_node_attr(query_jumble_location);
 } FetchStmt;

In terms of silencing the numbers, that's fine by me.  Now one issue
is that this also masks FETCH_ALL which is a specific keyword in the
grammar.

Should we offer something more consistent with DeallocateStmt, where
we have a boolean flag that would be set when ALL is specified,
included in the jumbling?  This would mean two separate entries: one
for the constants and one for ALL.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to