Re: Improve explicit cursor handling in pg_stat_statements

Sami Imseih <samimseih@gmail.com>

From: Sami Imseih <samimseih@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-06-05T12:42:48Z
Lists: pgsql-hackers

Attachments

> +  * If an direction_keyword (i.e., FETCH FORWARD) is used, set this field
> +  * to distinguish it from its numeric counterpart (i.e., FETCH 1). This
> +  * value is set only within gram.y.
>
> One nitpick comment here is that I would have mentioned that this
> matters for query jumbling.

Done

> The tests can be in cursors.sql and not utility.sql, which is the test
> area for...  Cursors.  :D

Yeah, not sure how I missed the cursor.sql file.

> FetchDirectionKeywords could be in typedefs.list to avoid the
> indentation accident with the structure definition.

Done.

v5 attached.

--
Sami

Commits

  1. Show sizes of FETCH queries as constants in pg_stat_statements