Skip to content
Snippets Groups Projects
Commit 8d48d89d authored by Tom Lane's avatar Tom Lane
Browse files

Variant horology resultfiles are inconsistent with the test, again.

parent 8ae9ad1c
Branches
Tags
No related merge requests found
...@@ -736,20 +736,66 @@ SELECT '' as "54", d1 as timestamp, ...@@ -736,20 +736,66 @@ SELECT '' as "54", d1 as timestamp,
-- --
-- abstime, reltime arithmetic -- abstime, reltime arithmetic
-- --
SELECT '' AS four, f1 AS abstime, SELECT '' AS ten, ABSTIME_TBL.f1 AS abstime, RELTIME_TBL.f1 AS reltime
date_part('year', f1) AS year, date_part('month', f1) AS month, WHERE (ABSTIME_TBL.f1 + RELTIME_TBL.f1)
date_part('day',f1) AS day, date_part('hour', f1) AS hour, < abstime 'Jan 14 14:00:00 1971'
date_part('minute', f1) AS minute, date_part('second', f1) AS second ORDER BY abstime, reltime;
FROM ABSTIME_TBL ten | abstime | reltime
WHERE isfinite(f1) and f1 <> abstime 'current' -----+------------------------------+---------------
ORDER BY abstime; | Sat May 10 23:59:12 1947 PST | @ 14 secs ago
four | abstime | year | month | day | hour | minute | second | Sat May 10 23:59:12 1947 PST | @ 1 min
------+------------------------------+------+-------+-----+------+--------+-------- | Sat May 10 23:59:12 1947 PST | @ 5 hours
| Sat May 10 23:59:12 1947 PST | 1947 | 5 | 10 | 23 | 59 | 12 | Sat May 10 23:59:12 1947 PST | @ 10 days
| epoch | 1969 | 12 | 31 | 16 | 0 | 0 | Sat May 10 23:59:12 1947 PST | @ 3 mons
| Sun Jan 14 03:14:21 1973 PST | 1973 | 1 | 14 | 3 | 14 | 21 | epoch | @ 14 secs ago
| Mon May 01 00:30:30 1995 PDT | 1995 | 5 | 1 | 0 | 30 | 30 | epoch | @ 1 min
(4 rows) | epoch | @ 5 hours
| epoch | @ 10 days
| epoch | @ 3 mons
(10 rows)
-- these four queries should return the same answer
-- the "infinity" and "-infinity" tuples in ABSTIME_TBL cannot be added and
-- therefore, should not show up in the results.
SELECT '' AS three, ABSTIME_TBL.*
WHERE (ABSTIME_TBL.f1 + reltime '@ 3 year') -- +3 years
< abstime 'Jan 14 14:00:00 1977';
three | f1
-------+------------------------------
| Sun Jan 14 03:14:21 1973 PST
| epoch
| Sat May 10 23:59:12 1947 PST
(3 rows)
SELECT '' AS three, ABSTIME_TBL.*
WHERE (ABSTIME_TBL.f1 + reltime '@ 3 year ago') -- -3 years
< abstime 'Jan 14 14:00:00 1971';
three | f1
-------+------------------------------
| Sun Jan 14 03:14:21 1973 PST
| epoch
| Sat May 10 23:59:12 1947 PST
(3 rows)
SELECT '' AS three, ABSTIME_TBL.*
WHERE (ABSTIME_TBL.f1 - reltime '@ 3 year') -- -(+3) years
< abstime 'Jan 14 14:00:00 1971';
three | f1
-------+------------------------------
| Sun Jan 14 03:14:21 1973 PST
| epoch
| Sat May 10 23:59:12 1947 PST
(3 rows)
SELECT '' AS three, ABSTIME_TBL.*
WHERE (ABSTIME_TBL.f1 - reltime '@ 3 year ago') -- -(-3) years
< abstime 'Jan 14 14:00:00 1977';
three | f1
-------+------------------------------
| Sun Jan 14 03:14:21 1973 PST
| epoch
| Sat May 10 23:59:12 1947 PST
(3 rows)
-- --
-- Conversions -- Conversions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment