Anmelden

Postgres FM· Folge 163

Gapless sequences

Freitag, 31. Oktober 2025 · 40 min

MP3

Shownotes

Nik and Michael discuss the concept of gapless sequences — when you might want one, why sequences in Postgres can have gaps, and an idea or two if you do want them.
And one quick clarification: changing the CACHE option in CREATE SEQUENCE can lead to even more gaps, the docs mention it explicitly.

Here are some links to things they mentioned:
• CREATE SEQUENCE postgresql.org/docs/current/sql-createsequence…
• Sequence Manipulation Functions postgresql.org/docs/current/functions-sequence…
• One, Two, Skip a Few (post by Pete Hamilton from Incident io) incident.io/blog/one-two-skip-a-few
• Postgres sequences can commit out-of-order (blog post by Anthony Accomazzo / Sequin) blog.sequinstream.com/postgres-sequences-can-c…
• Logical Replication of sequences (hackers thread) postgresql.org/message-id/flat/CAA4eK1LC%2BKJi…
• Synchronization of sequences to subscriber (patch entry in commitfest) commitfest.postgresql.org/patch/5111
• Get or Create (episode with Haki Benita) postgres.fm/episodes/get-or-create
• German tank problem en.wikipedia.org/wiki/German_tank_problem

~~~
What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, (postgres.fm/people) or by commenting on our Google doc (docs.google.com/document/d/1PNGSn_d0A7gTR4C0p6…)!

~~~
Postgres FM is produced by:
• Michael Christofides, founder of pgMustard (pgmustard.com)
• Nikolay Samokhvalov, founder of Postgres.ai (postgres.ai)

With credit to:
• Jessie Draws for the elephant artwork

Anmelden oder registrieren

Jetzt

0:00 / 0:00