model-writtenrun 3646 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Christian Maurer reported that PostgreSQL 16.1 unexpectedly accepted some interval subtractions beyond the timestamp lower bound, including subtracting 2483590 days from 2000-01-01 #1.
- Tom Lane confirmed the behavior was erroneous and supplied a patch checking the Julian-date intermediate used by timestamp interval arithmetic #2.
- The patch checks signed integer overflow and rejects negative Julian dates for timestamp, while allowing Julian date -1 for timestamptz to accommodate timezone rotation #2.
- Tom Lane committed the supplied logic with two added regression cases in 25cd2d6402; the other supplied candidate, c3bdb25fb5, is the same fix on REL_12_STABLE.
- The thread ends with Tom Lane's patch submission and contains no subsequent review or confirmation #2; the supplied commits establish that the fix landed, with their messages calling for backpatching to all supported branches 25cd2d6402 c3bdb25fb5.