AI Infrastructure
A Higher Dataset Row ID Can Commit Before a Lower One
In PostgreSQL 18, a sequence can assign ID 101 to transaction A and then 102 to transaction B, while B commits first. A reader can consequently receive 102 before 101 becomes visible. If a proposed incremental handoff remembers 102 and subsequently returns only IDs greater than 102, it misses 101 when A commits. Distinct, ascending allocations establish identifier order; complete coverage of newly committed rows requires evidence about commitment and the returned population.
01
Define what the remembered ID is supposed to establish
Consider an offer for incremental AI dataset inputs. Its stated rule is to return committed rows whose IDs exceed the greatest ID previously returned, then remember the new greatest ID. The buyer needs to know whether this delivers every relevant newly committed insert across successive handoffs.
PostgreSQL's nextval operation advances a sequence atomically. Concurrent callers can obtain distinct values without waiting for the transaction using an earlier value to finish. Allocating the identifier and committing the inserted row are separate events.
The maximum returned ID describes what the reader has encountered. Treating it as a completed boundary adds another claim: no relevant row at or below that number can become committed later without being included in the handoff. Sequence allocation alone supplies no such claim. Evaluate the offer against that additional coverage requirement.
02
SEQ26: A obtains 101, then B obtains 102
SEQ26 is a fictional chronology derived from the documented behavior, with no database test executed. Fix one PostgreSQL 18 primary database, one ordinary table and two separate writer transactions, A and B. Their two candidate rows have different IDs from one sequence. The reader starts with remembered ID 100; earlier data is outside the exercise.
The sequence has increment 1, cache 1 and no cycling. There are no resets or directly assigned IDs. A obtains 101 from nextval and inserts its row, but leaves its transaction uncommitted. B later obtains 102 and inserts its different row. At this point B has also not committed. Both allocated numbers exist, while neither inserted row is yet committed.
The consumer is read-only and uses ordinary Read Committed statements without locking clauses. Authorized access and complete return of each statement's selected population are stipulated. There are no other writers, conflicting row updates, rollbacks, deletions, crashes or additional filters. These premises isolate commitment order even when allocation is ascending.
03
B commits; the first reader statement returns 102
B now successfully commits the row with ID 102. A remains open with its row 101 uncommitted. The commit of B does not commit A's separate transaction.
Only after B's commit does the reader's first statement begin. PostgreSQL 18 Read Committed gives this ordinary statement a snapshot that includes changes committed before it starts. The reader has no writes of its own.
Among the two candidate rows, 102 is therefore visible and 101 is not. Applying the proposed selection above remembered ID 100 returns 102. The hypothetical handoff delivers that row and advances its remembered ID to 102. This first return respects the stated visibility rule; it has read no uncommitted row.
References: [S2]
04
A commits; the next handoff omits 101
A now successfully commits its row with ID 101. The reader's second ordinary statement starts afterward. Its Read Committed snapshot includes both committed candidate rows: the visible ID set is now {101, 102}. This is set notation, with no claim about the order of rows returned by SQL.
Relative to the first statement, the newly visible candidate is 101. Yet the proposed handoff now selects only IDs greater than its remembered 102. Neither 101 nor 102 satisfies that condition, so it returns an empty population.
Across the two handoffs, the delivered union is {102}, while the final committed candidate set is {101, 102}. Row 101 has been omitted. It committed successfully, remains in the table and is visible to the later statement. The omission follows from the handoff's numerical selection boundary.
The sequence allocation order was A/101, then B/102. The commit order was B/102, then A/101. A committed row with the larger ID did not establish a complete committed prefix through that ID. Under the unchanged greater-than rule, later repetitions also cannot admit 101.
References: [S2]
05
Connect the promised population to visibility and actual returns
An offer limited to numerically greater IDs can accurately describe SEQ26's returns as 102, then nothing. An offer promising every newly committed candidate row must additionally account for 101 after A commits. Those promises describe different deliverables, even though the first handoff succeeds in both descriptions.
Ask the appointed data or database provider to trace a nonconfidential late-commit case through the offered system. The explanation should identify the relevant table and row population, each writer's allocation and commit, when the reader statements establish visibility, the remembered boundary and the rows actually handed over. For SEQ26, the decisive question is how the promised handoff includes 101 after it becomes committed.
If a provider relies on an additional guarantee to rule out this chronology, have it identify that guarantee and evidence that it applies to the offered workflow. A unique row identifier, a largest-seen-ID figure or a successful read receipt cannot establish that coverage on its own.
Acceptance of a complete-newly-committed-row promise needs a connection between the commitment boundary and returned-row evidence. The chronology identifies the missing property without selecting a database or ingestion implementation.
06
Keep abort gaps and sequence caching in their own scope
PostgreSQL documents that a nextval value is not reclaimed when the calling transaction aborts. An absent number can therefore arise without a committed row ever having existed at that ID. A numerical gap alone cannot count missing or deleted committed records. SEQ26 supplies the stronger evidence directly: 101 eventually commits, yet the handoff excludes it.
The CREATE SEQUENCE notes also qualify ordering when cache exceeds 1. Separate sessions can return values from their reserved ranges in an order that is not globally ascending. The sequence's last_value can reflect a reserved value that nextval has not yet returned.
SEQ26 deliberately uses cache 1 and ascending allocations, so neither cross-session cache ordering nor an aborted allocation explains its omission. Cache 1 makes the allocation chronology simple; it supplies no commitment-order guarantee.
08
Scope any separate equipment-cabling requirement
If the wider platform project also needs physical connections between equipment, Leviathan's Structured Cabling & Fiber Installation service and the related project inquiry provide a route to discuss agreed fiber and copper work, endpoint labels and connection records.
Share a nonconfidential equipment and site outline, approved endpoints and routes, material-supply responsibilities and required physical handoff. This inquiry concerns the separately scoped physical installation. Database administration, dataset integration and committed-row completeness remain with the appointed data and software providers.
References: [L1]
09Sources
Primary sources
- [S1]PostgreSQL 18: 9.17. Sequence Manipulation FunctionsChecked 2026-10-21. Defines atomic nextval allocation and non-reclamation after an abort. Supports separating identifier allocation from transaction commitment and interpreting gaps without assuming a missing committed row.
- [S2]PostgreSQL 18: 13.2. Transaction IsolationChecked 2026-10-21. The sequence exception and section 13.2.1 distinguish sequence state from ordinary Read Committed row visibility. Applies to the read-only, nonlocking statements in SEQ26.
- [S3]PostgreSQL 18: CREATE SEQUENCEChecked 2026-10-21. Defines increment, cycling and caching parameters. Its concurrent-caching notes distinguish sequential generation with cache 1 from cross-session return order with larger caches.
- [L1]Leviathan Systems: Structured Cabling & Fiber InstallationChecked 2026-10-21. Describes agreed physical fiber and copper installation, endpoint identification and handoff records. Relevant to a separate equipment-cabling requirement.
10Related
Related Leviathan resources
Contact
Does the wider project need physical cabling?
Share a nonconfidential equipment and site outline, approved endpoints, material responsibilities and required connection records to discuss physical installation scope and availability.