Re: Return INT_MAX or INT_MIN from strtoint() on overflow

From: Prashant Chinnam <crprashant(at)hotmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, surya poondla <suryapoondla4(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Takeshi Ideriha <iderihatakeshi(at)gmail(dot)com>
Subject: Re: Return INT_MAX or INT_MIN from strtoint() on overflow
Date: 2026-10-30 02:28:20
Message-ID: SN7P223MB0600D5E6BEE08383ED96C875DD6D2@SN7P223MB0600.NAMP223.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tom,

>My thought here is to back-patch the strtoint() change.
>I cannot envision any case that that would make worse.
>And failing to do so leaves a land-mine for potential
>future back-patches of code using strtoint().

Thanks -- back-patching the strtoint() change removes my
only reason for preferring strtoi64() in patch [1]. Once
it has landed, I will switch that patch back to
strtoint(); that was the shape of my original v1, minus
the errno workaround that the saturating return value
makes unnecessary.

Regards,
Prashant Chinnam

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-30 02:30:54 Re: pg_upgrade doesn't copy ICU rules on template0
Previous Message shihao zhong 2026-10-30 02:27:21 Re: [PG19] pg_upgrade --check passes, then the upgrade fails