Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL); - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Date
Msg-id 755165.1723822675@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);  (Bruce Momjian <bruce@momjian.us>)
Responses Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
List pgsql-bugs
Bruce Momjian <bruce@momjian.us> writes:
> On Thu, Aug 15, 2024 at 10:45:58PM -0400, Bruce Momjian wrote:
>> I tested master, patch version 2 and patch version 3 with some sample
>> extract() queires, attached.  I like patch version 2.

I'm still pretty dissatisfied with both versions :-(

> I think there are two more issues.  In patch version 3, when months is
> zero and you check days, you should also check seconds if days is zero.

Eh?  v3 does that:

+                else if (interval->day > 0 ||
+                         (interval->day == 0 && interval->time >= 0))

But I'm starting to despair of reaching a solution that's actually
self-consistent.  Maybe we should leave the DTK_QUARTER behavior
alone, and content ourselves with adding DTK_WEEK.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);