Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4i0a-000Rmu-SA for pgsql-bugs@arkaria.postgresql.org; Wed, 08 May 2024 14:11:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s4i0X-001Dbd-Rt for pgsql-bugs@arkaria.postgresql.org; Wed, 08 May 2024 14:10:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4i0X-001DbV-JT for pgsql-bugs@lists.postgresql.org; Wed, 08 May 2024 14:10:57 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4i0T-0002Bi-Oj for pgsql-bugs@lists.postgresql.org; Wed, 08 May 2024 14:10:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 448EAmDZ476284; Wed, 8 May 2024 10:10:48 -0400 From: Tom Lane To: jian he cc: Francisco Olarte , Michael Bondarenko , pgsql-bugs@lists.postgresql.org, dgrowleyml@gmail.com, Peter Eisentraut Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL); In-reply-to: References: <18348-b097a3587dfde8a4@postgresql.org> <3709307.1708201825@sss.pgh.pa.us> <3749306.1708222748@sss.pgh.pa.us> <222870.1708458150@sss.pgh.pa.us> <270582.1708462564@sss.pgh.pa.us> <166456.1715117228@sss.pgh.pa.us> Comments: In-reply-to jian he message dated "Wed, 08 May 2024 09:03:56 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <476282.1715177448.1@sss.pgh.pa.us> Date: Wed, 08 May 2024 10:10:48 -0400 Message-ID: <476283.1715177448@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk jian he writes: > 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 > ? Hmm, I read it as being "the number of (whole) weeks in the interval". Starting with week 1 is what happens in the timestamp case, true, but I don't find that appropriate for interval. By analogy, regression=# select extract(day from interval '23 hours'); extract --------- 0 (1 row) There's no such thing as "day 0" in the timestamp case, but that doesn't make this wrong. In any case, I'm starting to wonder why this issue is on the v17 open items list. These are hardly new bugs in 17. If there's still differences of opinion about what the definition should be, I think cramming in a change post-feature-freeze is not appropriate. Let's just queue the issue for the next commitfest (already done at [1]) and take it off the open items list. regards, tom lane [1] https://commitfest.postgresql.org/48/4979/