Re: Sequence Access Methods, round two
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kirill Reshke <reshkekirill@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, Peter Smith <smithpb2250@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-16T00:22:18Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Refactor init_params() in sequence.c to not use FormData_pg_sequence_data
- ba3d93b2e806 19 (unreleased) landed
-
Fix comment thinko in sequence.c
- 17a3f79f812c 17.0 landed
-
Group more closely cache updates for backends in sequence.c
- 6e951bf98e2e 17.0 landed
-
Introduce sequence_*() access functions
- 449e798c77ed 17.0 landed
On Fri, Aug 15, 2025 at 12:36:00PM +0500, Kirill Reshke wrote: > 0001 - LGTM? Thanks for the review. Yes, I am eyeing at applying this refactoring piece to limit the footprint of Form_pg_sequence_data. The expectations of reset_state are not completely documented at the top of init_params(), because it is not only about nextval(). I'll try to think about a more careful wording. > 0002. WFM, the sole observation I have is that we incorporate sequence > logic to AlterTable utilities, making it less clear of what they > actually do. Thanks, I am also looking at applying this part of the patch set. There is a second reason for that: we don't track yet what kind of attributes are created within a CREATE SEQUENCE, so ADD COLUMN TO SEQUENCE is IMO also useful on its own to make user-facing some of the actions taken internally by the backend in this case. Perhaps there's an argument that people do not like the AddColumnToView layer, and that we should not expand that to sequences, but I like this new separation concept for the deparsing logistics. > I see we already have code path handling CREATE VIEW (in > AlterTableGetLockLevel for example), so maybe it is worth renaming > AlterTable* to AlterRelation*? > It would be really invasive refactoring though, so maybe we should > ignore this slight inconsistency in function names and what they > actually do. Some of these AlterTable* sub-structures are also shared for some code paths of view, matviews and sequences, if I recall correctly. I'm used to this code using AlterTable things, so perhaps my opinion is just biased based on that. -- Michael