Re: Infinite Interval
Joseph Koshakow <koshy44@gmail.com>
From: Joseph Koshakow <koshy44@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-15T23:43:29Z
Lists: pgsql-hackers
On Mon, Dec 12, 2022 at 8:05 AM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote: > > Hi Joseph, > I stumbled upon this requirement a few times. So I started working on > this support in my spare time as a hobby project to understand > horology code in PostgreSQL. This was sitting in my repositories for > more than an year. Now that I have someone else showing an interest, > it's time for it to face the world. Rebased it, fixed conflicts. > > PFA patch implementing infinite interval. It's still WIP, there are > TODOs in the code and also the commit message lists things that are > known to be incomplete. You might want to assess expected output > carefully That's great! I was also planning to just work on it as a hobby project, so I'll try and review and add updates as I find free time as well. > > The proposed design from the most recent thread was to reserve > > INT32_MAX months for infinity and INT32_MIN months for negative > > infinity. As pointed out in the thread, these are currently valid > > non-infinite intervals, but they are out of the documented range. > > The patch uses both months and days together to avoid this problem. Can you expand on this part? I believe the full range of representable intervals are considered valid as of v15. - Joe Koshakow
Commits
-
Support +/- infinity in the interval data type.
- 519fc1bd9e9d 17.0 landed
-
Avoid integer overflow hazard in interval_time().
- 3850d4dec1d9 17.0 landed
-
Guard against overflow in make_interval().
- b2d55447a563 17.0 landed
-
Fix minmax-multi on infinite date/timestamp values
- 8da86d62a112 17.0 cited
-
Optimize various aggregate deserialization functions, take 2
- 0c882a298881 17.0 cited
-
Remove dead code in DecodeInterval()
- d6d1430f4043 17.0 cited
-
Accept "+infinity" in date and timestamp[tz] input.
- 2ceea5adb026 16.0 cited
-
Fix overflow hazards in interval input and output conversions.
- e39f99046710 15.0 cited