model-writtenrun 52 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Chao Li proposed making strtoint() return INT_MAX or INT_MIN on overflow, matching strtol() semantics and enabling callers to clamp in the correct direction; his attached patch passed make check-world #1.
- Surya Poondla questioned the need because callers should check errno #2, while Takeshi Ideriha supported exposing overflow direction #3; Chao explained that pgcrypto's range checks could use saturated results directly, although a separate NOTICE-reporting fix remained necessary #4.
- Tom Lane supported matching strtol() semantics so sign tests and range checks remain meaningful, even independently of current callers #5.
- Prashant Chinnam reported a caller audit finding no dependence on truncated results, flagged existing ecpg range-check concerns, and initially preferred strtoi64() for a separate pgcrypto fix because of stable-branch compatibility #6; Tom proposed backpatching strtoint() #7, and Prashant consequently agreed to switch that separate patch back to strtoint() after landing #8.
- Tom committed the attached patch with revised overflow detection and comments as c2d5c09a6b, backpatched through PostgreSQL 14, and explained that retaining cast-and-compare avoids potential compiler warnings with 32-bit long #9.
- Chao thanked Tom for pushing, closing this thread with the strtoint() change landed and no further patch revision pending #10.