From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix extract epoch from interval calculation
Date: Tue, 19 Apr 2022 19:12:01 +0000
Message-ID: <E1ngtGb-0007ej-Eg@gemulon.postgresql.org> (raw)
Fix extract epoch from interval calculation
The new numeric code for extract epoch from interval accidentally
truncated the DAYS_PER_YEAR value to an integer, leading to results
that mismatched the floating-point interval_part calculations.
The commit a2da77cdb4661826482ebf2ddba1f953bc74afe4 that introduced
this actually contains the regression test change that this reverts.
I suppose this was missed at the time.
Reported-by: Joseph Koshakow <koshy44@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/CAAvxfHd5n%3D13NYA2q_tUq%3D3%3DSuWU-CufmTf-Ozj%3DfrEgt7pX...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f2a2bf66c87e14f07aefe23cbbe2f2d9edcd9734
Modified Files
--------------
src/backend/utils/adt/timestamp.c | 14 ++++++++++----
src/test/regress/expected/interval.out | 4 ++--
2 files changed, 12 insertions(+), 6 deletions(-)
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-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: Fix extract epoch from interval calculation
In-Reply-To: <E1ngtGb-0007ej-Eg@gemulon.postgresql.org>
References: <E1ngtGb-0007ej-Eg@gemulon.postgresql.org>
* 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