News for hackers. Stuff that matters.
Re:Postgres sequences can skip 32 unexpectedly by advisedwang on Friday July 16, 2021 @11:35AM (#27857351)
You would run into this problem even if you aren't using the database number as your primary key. We don't want to force the user to generate the incident handle (slowing down incident creation) so a sequence of number is useful.

Generating the sequence in application logic can make it challenging to guarantee we don't duplicate numbers if two requests come in at once (you don't want locks/global synchronous state in the application if you can avoid it), so having the database generate them is a good fit.

There are no comments on this comment yet.