Re: Infinite Interval - Mailing list pgsql-hackers

From jian he
Subject Re: Infinite Interval
Date
Msg-id CACJufxGEpX6DzC4BTTkbnsCB7kS6bXi0RrPAyqnivBmbQC8_1A@mail.gmail.com
Whole thread Raw
In response to Re: Infinite Interval  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: Infinite Interval
Re: Infinite Interval
List pgsql-hackers
On Wed, Sep 13, 2023 at 6:13 PM Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:
>
> to sum(). I am planning to work on this next week but in case somebody
> else wants to pick this up here are patches with other things fixed.
>
> --
> Best Wishes,
> Ashutosh Bapat


hi. some doc issues.

-     <literal>decade</literal>, <literal>century</literal>, and
<literal>millennium</literal>).
+     <literal>decade</literal>, <literal>century</literal>, and
<literal>millennium</literal>
+     for all types and <literal>hour</literal> and
<literal>day</literal> just for <type>interval</type>).

The above part seems not right. some fields do not apply to interval data types.
test case:
SELECT EXTRACT(epoch FROM interval 'infinity')  as epoch
        ,EXTRACT(YEAR FROM interval 'infinity') as year
        ,EXTRACT(decade FROM interval 'infinity') as decade
        ,EXTRACT(century FROM interval 'infinity') as century
        ,EXTRACT(millennium FROM interval 'infinity') as millennium
        ,EXTRACT(month FROM interval 'infinity') as mon
        ,EXTRACT(day FROM interval 'infinity')  as day
        ,EXTRACT(hour FROM interval 'infinity') as hour
        ,EXTRACT(min FROM interval 'infinity')  as min
        ,EXTRACT(second FROM interval 'infinity') as sec;

--------------------

-          <entry><type>date</type>, <type>timestamp</type></entry>
+          <entry><type>date</type>, <type>timestamp</type>,
<type>interval</type></entry>
           <entry>later than all other time stamps</entry>

it seems we have forgotten to mention the -infinity case, we can fix
the doc together, since <type>timestamptz</type>  also applies to
+/-infinity.



pgsql-hackers by date:

Previous
From: Himanshu Upadhyaya
Date:
Subject: Re: CHECK Constraint Deferrable
Next
From: Krishnakumar R
Date:
Subject: Small patch modifying variable name to reflect the logic involved