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-04T16:51:56Z
Lists: pgsql-hackers
Attachments
- v4-0001-Normalize-variable-fetch-sizes-in-a-FETCH-command.patch (application/octet-stream) patch v4-0001
> Hmm. I was not sure if we'd really need to get down to that, as most > of the grammar keywords have the same parsed meaning, but there's a > good point with LAST for example that uses a negative value for > howMany. If we silence the number, LAST would map with everything > else that has FETCH_ABSOLUTE. That would be confusing. yes, that is another good case. I think distinguishing between the various keywords makes the most sense. > > I considered introducing an enum for these explicit direction values, but > > didn’t find it particularly useful. If you think it would be beneficial, > > I can define an enum in parsenodes.h > > 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. -- Sami
Commits
-
Show sizes of FETCH queries as constants in pg_stat_statements
- bee23ea4ddc4 19 (unreleased) landed