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-09-01T04:33:45Z
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 →
  1. Refactor init_params() in sequence.c to not use FormData_pg_sequence_data

  2. Fix comment thinko in sequence.c

  3. Group more closely cache updates for backends in sequence.c

  4. Introduce sequence_*() access functions

Attachments

On Thu, Aug 21, 2025 at 11:57:58AM +0900, Michael Paquier wrote:
> Yes, that may be useful, but I don't think that this should use the
> psql variable to hide table AMs.  I am rebasing a new patch set, v18,
> with a couple of changes:
> - Added your feedback about psql.
> - I have put more thoughts into the code shared between the in-core
> sequence method and the snowflake one, and looked at reducing the
> duplication between the two.  At the end, I have introduced a new
> header called sequence_page.h, which is able to reduce the work for
> AMs when these rely on a single page through the addition of macros
> able to initialize and read sequence pages.  In this patch set, this
> new part is labelled with 0006.
> - Fixed a few more things, like comments.

Another rebase required due to the business with BufferGetPage() in
710e6c4301ee.

By the way, I have remembered the reason why I have introduced
AT_AddColumnToSequence as a new ALTER TABLE subcommands: ACL check for
sequences.  Like views, this simplifies the object type check a lot.
--
Michael