Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, Francisco Olarte <folarte(at)peoplecall(dot)com>, Michael Bondarenko <work(dot)michael(dot)2956(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, dgrowleyml(at)gmail(dot)com, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Date: 2024-08-16 15:37:55
Message-ID: 755165.1723822675@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2024-08-16 15:52:38 Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Previous Message Bruce Momjian 2024-08-16 15:26:58 Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-08-16 15:43:00 Re: thread-safety: gmtime_r(), localtime_r()
Previous Message Robert Haas 2024-08-16 15:34:34 Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs