model-writtenrun 4033 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Uwe Binder reported that to_tsvector rejected a 320-million-byte repetitive input with an invalid allocation request, despite the input itself fitting within PostgreSQL's text limit #1.
- Alvaro Herrera traced the failure to the initial word-count estimate and supplied a patch permitting huge allocations, while warning that other text-search and storage limits made general support for huge values problematic #2.
- Tom Lane opposed switching to huge allocations, questioned the unchanged array-reallocation paths, and proposed capping the initial estimate at MaxAllocSize / sizeof(ParsedWord) instead #3.
- Tom supplied the replacement cap and reported that the original example completed because it contained few distinct words; inputs requiring excessive array growth would still encounter the existing implementation limit #4.
- Tom then supplied a separate ParsedWord layout optimization, reducing its 64-bit size from 40 to 24 bytes by narrowing alen and removing padding; this was the final thread message, with both patches proposed and the layout change intended for development only #5.
- The allocation cap subsequently landed unchanged as cf1c65070a from #4 and was backpatched; the separately listed candidate 0fb91ed2b0 is its PostgreSQL 11 backport.
- The layout optimization subsequently landed unchanged as 036297cf1b from #5, without backpatching because it breaks ABI compatibility; the original huge-allocation approach was superseded.