Hacker News new | ask | show | jobs
by WilcoKruijer 411 days ago
I’d like to see a true monotonic counter in Postgres. Serials can increment out of order when multiple transactions are active. We can obtain the WAL LSN, but it’s not related to the currently active transaction. I really like FoundationDB’s versionstamp, would be great to have that in Postgres.
2 comments

How is a "true monotonic counter" supposed to interact with atomicity and isolation of transactions? Sounds like a global bottleneck.

Is uniqueness sufficient or is it really required to step through all integers without missing any?

EDIT: Missing primary keys in-between also bothers me, however, never found a decent solution for this at scale.

Thanks for the reply,will surely look into it.