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-18T04:49:32Z
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
Attachments
- v17-0001-Integrate-addition-of-attributes-for-sequences-w.patch (text/x-diff) patch v17-0001
- v17-0002-Refactor-code-for-in-core-local-sequences.patch (text/x-diff) patch v17-0002
- v17-0003-Sequence-access-methods-backend-support.patch (text/x-diff) patch v17-0003
- v17-0004-Sequence-access-methods-dump-restore-support.patch (text/x-diff) patch v17-0004
- v17-0005-Sequence-access-methods-core-documentation.patch (text/x-diff) patch v17-0005
- v17-0006-snowflake-Add-sequence-AM-based-on-it.patch (text/x-diff) patch v17-0006
On Sat, Aug 16, 2025 at 09:22:18AM +0900, Michael Paquier wrote: > 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. Applied this one after more tweaking. >> 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. For this one, I'm having some second thoughts after re-reading Tomas point upthread, which is very close to your point. It is true that using AlterColumn is an implementation detail of sequences, because we store some of their data as heap. Using AddColumnToSequence feels indeed a bit out of place after more consideration. We could just reuse AlterColumn, saving from the extra sub-command. What do you think? Rebased the rest as attached, for now. -- Michael