{"type":"rich","version":"1.0","provider_name":"Transistor","provider_url":"https://transistor.fm","author_name":"Postgres FM","title":"Gapless sequences","html":"<iframe width=\"100%\" height=\"180\" frameborder=\"no\" scrolling=\"no\" seamless src=\"https://share.transistor.fm/e/51ef75f8\"></iframe>","width":"100%","height":180,"duration":2389,"description":"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.\nAnd one quick clarification: changing the CACHE option in CREATE SEQUENCE can lead to even more gaps, the docs mention it explicitly.\n \nHere are some links to things they mentioned:\nCREATE SEQUENCE https://www.postgresql.org/docs/current/sql-createsequence.html\nSequence Manipulation Functions https://www.postgresql.org/docs/current/functions-sequence.html\nOne, Two, Skip a Few (post by Pete Hamilton from Incident io) https://incident.io/blog/one-two-skip-a-few\nPostgres sequences can commit out-of-order (blog post by Anthony Accomazzo / Sequin) https://blog.sequinstream.com/postgres-sequences-can-commit-out-of-order\nLogical Replication of sequences (hackers thread) https://www.postgresql.org/message-id/flat/CAA4eK1LC%2BKJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ%40mail.gmail.com\nSynchronization of sequences to subscriber (patch entry in commitfest) https://commitfest.postgresql.org/patch/5111/\nGet or Create (episode with Haki Benita) https://postgres.fm/episodes/get-or-create\nGerman tank problem https://en.wikipedia.org/wiki/German_tank_problem\n\n~~~\nWhat did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!\n\n~~~\nPostgres FM is produced by:\nMichael Christofides, founder of pgMustard\nNikolay Samokhvalov, founder of Postgres.ai\n\nWith credit to:\nJessie Draws for the elephant artwork","thumbnail_url":"https://img.transistorcdn.com/NFbJlGhGV5mzIU1kM0iZ823A69pjZUNX40LszVO5LKI/rs:fill:0:0:1/w:400/h:400/q:60/mb:500000/aHR0cHM6Ly9pbWct/dXBsb2FkLXByb2R1/Y3Rpb24udHJhbnNp/c3Rvci5mbS9zaG93/LzMyMTQ3LzE3MTA3/OTEzODMtYXJ0d29y/ay5qcGc.webp","thumbnail_width":300,"thumbnail_height":300}