mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08: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
|
||||
(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()
|
||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||
FROM TIMESTAMP_TBL;
|
||||
|
@ -1189,6 +1189,13 @@ SELECT d1 as timestamptz,
|
||||
Mon Jan 01 17:32:01 2001 PST | -28800 | -8 | 0
|
||||
(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()
|
||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||
FROM TIMESTAMPTZ_TBL;
|
||||
|
@ -261,6 +261,9 @@ SELECT d1 as "timestamp",
|
||||
date_part( 'epoch', d1) AS epoch
|
||||
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()
|
||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||
FROM TIMESTAMP_TBL;
|
||||
|
@ -275,6 +275,9 @@ SELECT d1 as timestamptz,
|
||||
date_part( 'timezone_minute', d1) AS timezone_minute
|
||||
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()
|
||||
SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||
FROM TIMESTAMPTZ_TBL;
|
||||
|
Loading…
Reference in New Issue
Block a user