pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: jian he <jian.universality@gmail.com>
Cc: Francisco Olarte <folarte@peoplecall.com>
Cc: Michael Bondarenko <work.michael.2956@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org, dgrowleyml@gmail.com, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
Date: Fri, 16 Aug 2024 11:37:55 -0400
Message-ID: <755165.1723822675@sss.pgh.pa.us> (raw)
In-Reply-To: <Zr9vwnzROmfi_MI4@momjian.us>
References: <3749306.1708222748@sss.pgh.pa.us>
	<CACJufxHL0g73FPaRS+OGSYWJ0YbP6nEdVK79=wjL-TKU0_heDw@mail.gmail.com>
	<222870.1708458150@sss.pgh.pa.us>
	<270582.1708462564@sss.pgh.pa.us>
	<CACJufxFOjGpAQJ5EJ0=a1geERgdHW77SEdRyK8A_qwB3CVdwhQ@mail.gmail.com>
	<166456.1715117228@sss.pgh.pa.us>
	<CACJufxGFuZsj+31a204fFpxv_RCHA-u1h6WEBZ6qpjBVoio5dQ@mail.gmail.com>
	<476283.1715177448@sss.pgh.pa.us>
	<1079670.1720458208@sss.pgh.pa.us>
	<Zr69ZnXWlS_2_bvI@momjian.us>
	<Zr9vwnzROmfi_MI4@momjian.us>

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





view thread (31+ messages)  latest in thread

Message-ID: <755165.1723822675@sss.pgh.pa.us>
Permalink:  ../755165.1723822675@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/755165.1723822675@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, jian.universality@gmail.com, folarte@peoplecall.com, work.michael.2956@gmail.com, peter.eisentraut@enterprisedb.com
  Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);
  In-Reply-To: <755165.1723822675@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox