mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Add tests for date_part of epoch near upper bound of timestamp range
This exercises a special case in the implementations of date_part('epoch', timestamp[tz]) that was previously not tested.
This commit is contained in:
parent
4753ef37e0
commit
6131ffc43f
@ -1012,6 +1012,13 @@ SELECT d1 as "timestamp",
|
|||||||
Mon Jan 01 17:32:01 2001 | 200 | 21 | 3 | 2451912 | 978370321
|
Mon Jan 01 17:32:01 2001 | 200 | 21 | 3 | 2451912 | 978370321
|
||||||
(65 rows)
|
(65 rows)
|
||||||
|
|
||||||
|
-- value near upper bound uses special case in code
|
||||||
|
SELECT date_part('epoch', '294270-01-01 00:00:00'::timestamp);
|
||||||
|
date_part
|
||||||
|
---------------
|
||||||
|
9224097091200
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
FROM TIMESTAMP_TBL;
|
FROM TIMESTAMP_TBL;
|
||||||
|
@ -1189,6 +1189,13 @@ SELECT d1 as timestamptz,
|
|||||||
Mon Jan 01 17:32:01 2001 PST | -28800 | -8 | 0
|
Mon Jan 01 17:32:01 2001 PST | -28800 | -8 | 0
|
||||||
(66 rows)
|
(66 rows)
|
||||||
|
|
||||||
|
-- value near upper bound uses special case in code
|
||||||
|
SELECT date_part('epoch', '294270-01-01 00:00:00+00'::timestamptz);
|
||||||
|
date_part
|
||||||
|
---------------
|
||||||
|
9224097091200
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
FROM TIMESTAMPTZ_TBL;
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
@ -261,6 +261,9 @@ SELECT d1 as "timestamp",
|
|||||||
date_part( 'epoch', d1) AS epoch
|
date_part( 'epoch', d1) AS epoch
|
||||||
FROM TIMESTAMP_TBL;
|
FROM TIMESTAMP_TBL;
|
||||||
|
|
||||||
|
-- value near upper bound uses special case in code
|
||||||
|
SELECT date_part('epoch', '294270-01-01 00:00:00'::timestamp);
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
FROM TIMESTAMP_TBL;
|
FROM TIMESTAMP_TBL;
|
||||||
|
@ -275,6 +275,9 @@ SELECT d1 as timestamptz,
|
|||||||
date_part( 'timezone_minute', d1) AS timezone_minute
|
date_part( 'timezone_minute', d1) AS timezone_minute
|
||||||
FROM TIMESTAMPTZ_TBL;
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
|
||||||
|
-- value near upper bound uses special case in code
|
||||||
|
SELECT date_part('epoch', '294270-01-01 00:00:00+00'::timestamptz);
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
FROM TIMESTAMPTZ_TBL;
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user