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

From jian he
Subject Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Date
Msg-id CACJufxGFuZsj+31a204fFpxv_RCHA-u1h6WEBZ6qpjBVoio5dQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
List pgsql-bugs
On Wed, May 8, 2024 at 5:27 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Here's a more fleshed-out patch.  I don't think we really need to
> document the behavior for negative intervals; at least, we haven't
> done that so far for any other fields.  I did add testing of such
> cases though.
>

the doc looks good to me.
extract quarter from the interval makes sense to me.

but in real life, for week, we generally begin with 1?
like "the first week", "second week"

so should
select extract(week from interval '1 day');
return 1
?



pgsql-bugs by date:

Previous
From: "Wetmore, Matthew (CTR)"
Date:
Subject: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Next
From: Chris Travers
Date:
Subject: pg_rewind fails on Windows where tablespaces are used