Fix overflow in justify_interval related functions

Joseph Koshakow <koshy44@gmail.com>

From: Joseph Koshakow <koshy44@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2022-02-13T18:28:38Z
Lists: pgsql-hackers

Attachments

I mentioned this issue briefly in another thread, but the
justify_interval, justify_days, and justify_hours functions
all have the potential to overflow. The attached patch fixes
this issue.

Cheers,
Joe Koshakow

Commits

  1. Handle integer overflow in interval justification functions.