Re: Improve explicit cursor handling in pg_stat_statements - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Improve explicit cursor handling in pg_stat_statements
Date
Msg-id aEDsOuo4OuuvhhoU@paquier.xyz
Whole thread Raw
In response to Re: Improve explicit cursor handling in pg_stat_statements  (Sami Imseih <samimseih@gmail.com>)
Responses Re: Improve explicit cursor handling in pg_stat_statements
List pgsql-hackers
On Wed, Jun 04, 2025 at 11:51:56AM -0500, Sami Imseih wrote:
>> An enum would shine here IMO, because the value could be
>> self-documented and one would not need to guess what each integer
>> value means.  That could be something like a direction_keyword, filled
>> with FETCH_KEYWORD_LAST, FETCH_KEYWORD_BACKWARD, etc.
>
> Done in v4.

Mostly good here, some more comments.

+  * 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.

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

FetchDirectionKeywords could be in typedefs.list to avoid the
indentation accident with the structure definition.  There's no actual
practice about that for committers, this note will just serve as a
self-reminder once the v19 branch opens for business when I handle
this patch.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Custom Glibc collation version strings under LOCPATH
Next
From: Shinya Kato
Date:
Subject: Re: Partitioned tables and [un]loggedness