pgsql: Fix interval test, which was broken for floating-point timestamp

Started by Jeff Davisabout 12 years ago3 messagescomitters
Jump to latest
#1Jeff Davis
pgsql@j-davis.com

Fix interval test, which was broken for floating-point timestamps.

Commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b introduced a test that
couldn't be made consistent between integer and floating-point
timestamps.

It was designed to test the longest possible interval output length,
so removing four zeros from the number of hours, as this patch does,
is not ideal. But the test still has some utility for its original
purpose, and there aren't a lot of other good options.

Noah Misch suggested a different approach where we test that the
output either matches what we expect from integer timestamps or what
we expect from floating-point timestamps. That seemed to obscure an
otherwise simple test, however.

Reviewed by Tom Lane and Noah Misch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/348aa75a678069569923c501206d5a1ca03654e3

Modified Files
--------------
src/test/regress/expected/interval.out | 11 +++++++----
src/test/regress/sql/interval.sql | 5 ++++-
2 files changed, 11 insertions(+), 5 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jeff Davis (#1)
Re: pgsql: Fix interval test, which was broken for floating-point timestamp

Jeff Davis <jdavis@postgresql.org> writes:

Fix interval test, which was broken for floating-point timestamps.
Commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b introduced a test that
couldn't be made consistent between integer and floating-point
timestamps.

That patch was back-patched as far as 8.4, so if you're going to change
it, you need to back-patch too.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Jeff Davis
pgsql@j-davis.com
In reply to: Tom Lane (#2)
Re: pgsql: Fix interval test, which was broken for floating-point timestamp

On Tue, 2014-05-06 at 23:26 -0400, Tom Lane wrote:

Jeff Davis <jdavis@postgresql.org> writes:

Fix interval test, which was broken for floating-point timestamps.
Commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b introduced a test that
couldn't be made consistent between integer and floating-point
timestamps.

That patch was back-patched as far as 8.4, so if you're going to change
it, you need to back-patch too.

Done, thank you.

Jeff

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers