Re: Infinite Interval - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Re: Infinite Interval
Date
Msg-id CAAvxfHftquqVHrSZfjJkM5KTvM+m9aL8cMshWnteSoU=LPjHDQ@mail.gmail.com
Whole thread Raw
In response to Re: Infinite Interval  (jian he <jian.universality@gmail.com>)
Responses Re: Infinite Interval
List pgsql-hackers
On Thu, Jan 5, 2023 at 5:20 AM jian he <jian.universality@gmail.com> wrote:
>
>
>
> On Wed, Jan 4, 2023 at 10:13 PM jian he <jian.universality@gmail.com> wrote:
>>
>>
>>
>> I don't know how to generate an interval.out file.

Personally I just write the .out files manually. I think it especially
helps as a way to double-check that the results are what you expected.
After running make check a regressions.diff file will be generated with
all the differences between your .out file and the results of the test.


> logic combine and clean up for functions in backend/utils/adt/timestamp.c
(timestamp_pl_interval,timestamptz_pl_interval,interval_pl, interval_mi).
 

One thing I was hoping to achieve was to avoid redundant checks if
possible. For example, in the following code:
> +    if ((INTERVAL_IS_NOBEGIN(span1) && INTERVAL_IS_NOEND(span2))
> +      ||(INTERVAL_IS_NOBEGIN(span1) && !INTERVAL_NOT_FINITE(span2))
> +      ||(!INTERVAL_NOT_FINITE(span1) && INTERVAL_IS_NOEND(span2)))
> +           INTERVAL_NOBEGIN(result);
If `(INTERVAL_IS_NOBEGIN(span1) && INTERVAL_IS_NOEND(span2))` is false,
then we end up checking `INTERVAL_IS_NOBEGIN(span1)` twice

> For 1. I don't know how to format the code. I have a problem installing pg_indent. If the format is wrong, please
reformat.

I'll run pg_indent and send an updated patch if anything changes.

Thanks for your help on this patch!

- Joe Koshakow



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: moving extraUpdatedCols out of RangeTblEntry (into ModifyTable)
Next
From: Nathan Bossart
Date:
Subject: Re: fix and document CLUSTER privileges