Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: jian he <jian.universality@gmail.com>,
Francisco Olarte <folarte@peoplecall.com>,
Michael Bondarenko <work.michael.2956@gmail.com>,
pgsql-bugs@lists.postgresql.org, dgrowleyml@gmail.com,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2024-08-16T15:37:55Z
Lists: pgsql-bugs, pgsql-hackers
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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix extraction of week and quarter fields from intervals.
- 6be39d77a70d 18.0 landed
-
Doc: improve explanation of type interval, especially extract().
- fcd210d496da 17.0 landed
- ebf52e9b7532 14.12 landed
- eb1d008a7a18 13.15 landed
- 6d03e8109250 15.7 landed
- 3ad319b8cad4 16.3 landed