Re: Infinite Interval

From: Joseph Koshakow <koshy44(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Infinite Interval
Date: 2023-01-03 00:44:25
Message-ID: CAAvxfHexMfLSBf7t3EBxTLAJaaOsZZ6T7Cz-40nDyOR1zWjqwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have another patch, this one adds validations to operations that
return intervals and updated error messages. I tried to give all of the
error messages meaningful text, but I'm starting to think that almost all
of them should just say "interval out of range". The current approach
may reveal some implementation details and lead to confusion. For
example, some subtractions are converted to additions which would lead
to an error message about addition.

SELECT date 'infinity' - interval 'infinity';
ERROR: cannot add infinite values with opposite signs

I've also updated the commit message to include the remaining TODOs,
which I've copied below

1. Various TODOs in code.
2. Correctly implement interval_part for infinite intervals.
3. Test consolidation.
4. Should we just use the months field to test for infinity?

Attachment Content-Type Size
v7-0001-Support-infinite-interval.patch text/x-patch 69.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2023-01-03 01:15:54 Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)
Previous Message Karl O. Pinc 2023-01-03 00:00:15 Doc: Rework contrib appendix -- informative titles, tweaked sentences