Re: Fix a host of strto*() bugs

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tristan Partin <tristan(at)partin(dot)io>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, malis(at)pgrust(dot)com
Subject: Re: Fix a host of strto*() bugs
Date: 2026-08-02 23:35:35
Message-ID: am_UR27E4y3doKBW@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 31, 2026 at 05:03:38PM +0900, Michael Paquier wrote:
> Regarding 0001, yes, that's a bug. It is definitely not something
> that we could backpatch as we'd begin to reject inputs that were
> accidentally rejected, even if I am hoping that nobody in their right
> mind would use a '(1,)'::tid or a '(,1)'::tid to map to respectively
> (1,0) or (0,1).

One question that I have been asking to myself here is: could the ODBC
driver internally generate a tid value that may not be cross-platform
portable? And after diving into the code I think that the answer is
no by itself, but there are paths where a client application can
provide its own value. So I think that there is no practical argument
against making the strtoul() call with tid parsing more compliant to
the C standard. At least let's try it so on HEAD. If that proves to
be a experiment failure, we could always revert during the beta cycle
and move back to the old behavior. Here I'd favor more consistency in
our code base.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Scott Ray 2026-08-03 00:14:28 Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon
Previous Message Michael Paquier 2026-08-02 23:21:19 Re: Bug: XLogReader mishandles oversized multi-page xl_tot_len (potential memory corruption)