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

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: work(dot)michael(dot)2956(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Date: 2024-02-17 01:47:58
Message-ID: CACJufxHYQSKNnt8rS7GxvK04wf75nw_ugMaibFVVfrcdVMmF1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

in `9.9.1. EXTRACT, date_part`
EXTRACT(field FROM source)

I saw more inconsistencies with the doc when `source` is an interval.

the `minute` field
select extract(minute from interval '2011 year 16 month 35 day 48 hour
1005 min 71 sec 11 ms');
select extract(minute from interval '2011 year 16 month 35 day 48 hour
1005 min 2 sec 11 ms');
select extract(minute from interval '2011 year 16 month 35 day 48 hour
1005 min 2 sec 11 ms');

the `hour` field:
select extract(hour from interval '2011 year 16 month 35 day 48 hour
1005 min 71 sec 11 ms');
select extract(hour from interval '2011 year 16 month 35 day 48 hour
1005 min 2 sec 11 ms');
select extract(hour from interval '2011 year 16 month 35 day 48 hour
1005 min 71 sec 11111111111 ms');

the `quarter` field:
select extract(quarter from interval '2011 year 12 month 48 hour 1005
min 2 sec 11 ms');
SELECT EXTRACT(QUARTER FROM TIMESTAMP '2001-12-16 20:38:40');

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Bondarenko 2024-02-17 08:00:39 Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Previous Message Wetmore, Matthew (CTR) 2024-02-16 21:39:05 BUG #18350: Modifying predefined roles' unlimited connections for VA STIG cybersecurity checklist

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2024-02-17 04:34:51 Re: pg_upgrade and logical replication
Previous Message Tom Lane 2024-02-17 01:10:48 Re: Add bump memory context type and use it for tuplesorts