pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Zhihong Yu <zyu@yugabyte.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: Tom Lane PostgreSQL <tgl@sss.pgh.pa.us>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Isaac Morland <isaac.morland@gmail.com>
Cc: John W Higgins <wishdev@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Have I found an interval arithmetic bug?
Date: Tue, 20 Jul 2021 00:14:19 -0400
Message-ID: <20210720041419.GA5882@momjian.us> (raw)
In-Reply-To: <CALNJ-vQfTHNbH3VCeg3ChT42y1swnWtV-6iztthO8QfOE8wdwg@mail.gmail.com>
References: <B117C7D3-E4F9-44FE-9F7B-D5CE3C137304@yugabyte.com>
	<CALNJ-vRf8MUEhTMRDUJ5o8b_g-pFr8n99-yxaw8qWZX3Bae5XQ@mail.gmail.com>
	<20210508022308.GA27048@momjian.us>
	<CALNJ-vRg3oGr8VRGMQ=W4EWEdE-QuG2=K2jZ1+JK_bCsL-r2nQ@mail.gmail.com>
	<20210508024204.GB27048@momjian.us>
	<CALNJ-vQLukGOX5HKa7Z5tKYfNOyB6u0dU2+SuRFXExoJ_7m8QA@mail.gmail.com>
	<076E1871-8446-405C-9561-29FA03F46A4A@yesql.se>
	<20210630163516.GA3304@momjian.us>
	<CALNJ-vTD709opMzOyfT=KVtXaAvLmpqPGGEqqqXMSZwF8aQH1A@mail.gmail.com>
	<CALNJ-vQfTHNbH3VCeg3ChT42y1swnWtV-6iztthO8QfOE8wdwg@mail.gmail.com>

On Wed, Jul 14, 2021 at 09:03:21AM -0700, Zhihong Yu wrote:
> On Thu, Jul 8, 2021 at 10:22 AM Zhihong Yu <zyu@yugabyte.com> wrote:
>     On Wed, Jun 30, 2021 at 9:35 AM Bruce Momjian <bruce@momjian.us> wrote:
> 
>         On Tue, Jun 29, 2021 at 06:49:45PM +0200, Daniel Gustafsson wrote:
>         > > On 29 Jun 2021, at 18:50, Zhihong Yu <zyu@yugabyte.com> wrote:
>         >
>         > > Now that PG 15 is open for commit, do you think the patch can land
>         ?
>         >
>         > Adding it to the commitfest patch tracker is a good way to ensure
>         it's not
>         > forgotten about:
>         >
>         >       https://commitfest.postgresql.org/33/
> 
>         OK, I have been keeping it in my git tree since I wrote it and will
>         apply it in the next few days.
>     Thanks, Bruce.
> 
>     Hopefully you can get to this soon. 
> 
> Bruce: 
> Please see if the patch can be integrated now.

I found a mistake in my most recent patch.  For example, in master we
see this output:

	SELECT INTERVAL '1.8594 months';
	         interval
	--------------------------
	 1 mon 25 days 18:46:04.8

Obviously this should return '1 mon 26 days', but with my most recent
patch, it returned '1 mon 25 days'.  Turns out I had not properly used
rint() in AdjustFractDays, and in fact the function is now longer needed
because it is just a multiplication and an rint().

Updated patch attached.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.

Attachments:

  interval.diff.gz (application/gzip, 2.1K) download

view thread (95+ messages)  latest in thread

Message-ID: <20210720041419.GA5882@momjian.us>
Permalink:  ../20210720041419.GA5882@momjian.us/
Also on:    postgresql.org/message-id/20210720041419.GA5882@momjian.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bruce@momjian.us, zyu@yugabyte.com, daniel@yesql.se, bryn@yugabyte.com, tgl@sss.pgh.pa.us, pryzby@telsasoft.com, isaac.morland@gmail.com, wishdev@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Have I found an interval arithmetic bug?
  In-Reply-To: <20210720041419.GA5882@momjian.us>
  References: <B117C7D3-E4F9-44FE-9F7B-D5CE3C137304@yugabyte.com> <CALNJ-vRf8MUEhTMRDUJ5o8b_g-pFr8n99-yxaw8qWZX3Bae5XQ@mail.gmail.com> <20210508022308.GA27048@momjian.us> <CALNJ-vRg3oGr8VRGMQ=W4EWEdE-QuG2=K2jZ1+JK_bCsL-r2nQ@mail.gmail.com> <20210508024204.GB27048@momjian.us> <CALNJ-vQLukGOX5HKa7Z5tKYfNOyB6u0dU2+SuRFXExoJ_7m8QA@mail.gmail.com> <076E1871-8446-405C-9561-29FA03F46A4A@yesql.se> <20210630163516.GA3304@momjian.us> <CALNJ-vTD709opMzOyfT=KVtXaAvLmpqPGGEqqqXMSZwF8aQH1A@mail.gmail.com> <CALNJ-vQfTHNbH3VCeg3ChT42y1swnWtV-6iztthO8QfOE8wdwg@mail.gmail.com> <20210720041419.GA5882@momjian.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