News for hackers. Stuff that matters.
Re:Postgres sequences can skip 32 unexpectedly by peterejhamilton on Friday July 16, 2021 @11:45AM (#27857502)
Nice - we're using a very similar approach now (procedure that runs just before creation) which I think will last us a good while. Glad to know it's worked out well for you :)
Re:Postgres sequences can skip 32 unexpectedly by leftnode on Friday July 16, 2021 @12:02PM (#27857709)
Another added benefit is that you can build a simple interface to allow end users to adjust their sequences (or our support staff in this instance).

In our system, by default, all objects start at 1000. If a new account is created, and they want to increase a sequence to some value (say they already have 5000 invoices in QuickBooks and they want to start all new invoices at 10000 so they know every invoice #IN10000 and higher was created in our system), we have a simple interface that one of our support staff can go to arbitrarily increase the next value.