Mon Jan 01 17:32:01 2001
(65 rows)
--- Check behavior at the lower boundary of the timestamp range
+-- Check behavior at the boundaries of the timestamp range
SELECT '4714-11-24 00:00:00 BC'::timestamp;
timestamp
-----------------------------
ERROR: timestamp out of range: "4714-11-23 23:59:59 BC"
LINE 1: SELECT '4714-11-23 23:59:59 BC'::timestamp;
^
--- The upper boundary differs between integer and float timestamps, so no check
+SELECT '294276-12-31 23:59:59'::timestamp;
+ timestamp
+----------------------------
+ Sun Dec 31 23:59:59 294276
+(1 row)
+
+SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+ERROR: timestamp out of range: "294277-01-01 00:00:00"
+LINE 1: SELECT '294277-01-01 00:00:00'::timestamp;
+ ^
-- Demonstrate functions and operators
SELECT d1 FROM TIMESTAMP_TBL
WHERE d1 > timestamp without time zone '1997-01-02';
Mon Jan 01 17:32:01 2001 PST
(66 rows)
--- Check behavior at the lower boundary of the timestamp range
+-- Check behavior at the boundaries of the timestamp range
SELECT '4714-11-24 00:00:00+00 BC'::timestamptz;
timestamptz
---------------------------------
ERROR: timestamp out of range: "4714-11-23 23:59:59+00 BC"
LINE 1: SELECT '4714-11-23 23:59:59+00 BC'::timestamptz;
^
--- The upper boundary differs between integer and float timestamps, so no check
+SELECT '294276-12-31 23:59:59+00'::timestamptz;
+ timestamptz
+--------------------------------
+ Sun Dec 31 15:59:59 294276 PST
+(1 row)
+
+SELECT '294276-12-31 15:59:59-08'::timestamptz;
+ timestamptz
+--------------------------------
+ Sun Dec 31 15:59:59 294276 PST
+(1 row)
+
+SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+ERROR: timestamp out of range: "294277-01-01 00:00:00+00"
+LINE 1: SELECT '294277-01-01 00:00:00+00'::timestamptz;
+ ^
+SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+ERROR: timestamp out of range: "294277-12-31 16:00:00-08"
+LINE 1: SELECT '294277-12-31 16:00:00-08'::timestamptz;
+ ^
-- Demonstrate functions and operators
SELECT d1 FROM TIMESTAMPTZ_TBL
WHERE d1 > timestamp with time zone '1997-01-02';
SELECT d1 FROM TIMESTAMP_TBL;
--- Check behavior at the lower boundary of the timestamp range
+-- Check behavior at the boundaries of the timestamp range
SELECT '4714-11-24 00:00:00 BC'::timestamp;
SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
--- The upper boundary differs between integer and float timestamps, so no check
+SELECT '294276-12-31 23:59:59'::timestamp;
+SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
-- Demonstrate functions and operators
SELECT d1 FROM TIMESTAMP_TBL
SELECT d1 FROM TIMESTAMPTZ_TBL;
--- Check behavior at the lower boundary of the timestamp range
+-- Check behavior at the boundaries of the timestamp range
SELECT '4714-11-24 00:00:00+00 BC'::timestamptz;
SELECT '4714-11-23 16:00:00-08 BC'::timestamptz;
SELECT 'Sun Nov 23 16:00:00 4714 PST BC'::timestamptz;
SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
--- The upper boundary differs between integer and float timestamps, so no check
+SELECT '294276-12-31 23:59:59+00'::timestamptz;
+SELECT '294276-12-31 15:59:59-08'::timestamptz;
+SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
-- Demonstrate functions and operators
SELECT d1 FROM TIMESTAMPTZ_TBL