The Document Number Is Reserved Before the PDF Exists
The hard part of document numbering is not incrementing an integer. It is deciding what happens when the integer is reserved, rendering starts, and the render fails. PostgreSQL sequences are built for speed. They are not built for legal numbering. A sequence advances even if the surrounding transaction rolls back. For most applications that is fine. For invoices and board records, a gap is not invisible. If number 41 exists and number 43 exists, someone will ask what happened to 42. I needed...
Original Source
Read the full article at Dev →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.