Detect overflow in timestamp[tz] subtraction.
Tom Lane <tgl@sss.pgh.pa.us>
Detect overflow in timestamp[tz] subtraction. It's possible to overflow the int64 microseconds field of the output interval when subtracting two timestamps. Detect that instead of silently returning a bogus result. Nick Babadzhanian Discussion: https://postgr.es/m/CABw73Uq2oJ3E+kYvvDuY04EkhhkChim2e-PaghBDjOmgUAMWGw@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/timestamp.c | modified | +4 −1 |
| src/test/regress/expected/timestamp.out | modified | +9 −0 |
| src/test/regress/expected/timestamptz.out | modified | +9 −0 |
| src/test/regress/sql/timestamp.sql | modified | +4 −0 |
| src/test/regress/sql/timestamptz.sql | modified | +4 −0 |
Discussion
- Silent overflow of interval type 5 messages · 2023-02-15 → 2023-02-20