Re: Silent overflow of interval type - Mailing list pgsql-hackers

From Nick Babadzhanian
Subject Re: Silent overflow of interval type
Date
Msg-id CABw73UoEJyMpC3Gyg4mP+UjhWfndCqDE728T4679YrmyY3mjiA@mail.gmail.com
Whole thread Raw
In response to Re: Silent overflow of interval type  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Silent overflow of interval type
List pgsql-hackers
On Thu, Feb 16, 2023 at 1:12 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Yeah, I don't think this would create a performance problem, at least not
> if you're using a compiler that implements pg_sub_s64_overflow reasonably.
> (And if you're not, and this bugs you, the answer is to get a better

Please find attached the v2 of the said patch with the tests added. I
tested and it applies with all tests passing both on REL_14_STABLE,
REL_15_STABLE and master. I don't know how the decision on
backpatching is made and whether it makes sense here or not. If any
additional work is required, please let me know.

> By chance did you look at all other nearby cases, is it the only place
> with overflow?

Not really, no. The other place where it could overflow was in the
interval justification function and it was fixed about a year ago.
That wasn't backpatched afaict. See
https://postgr.es/m/CAAvxfHeNqsJ2xYFbPUf_8nNQUiJqkag04NW6aBQQ0dbZsxfWHA@mail.gmail.com

Regards,
Nick

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Allow logical replication to copy tables in binary format
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Support logical replication of DDLs