2000-01-05 07:06:23 +01:00
|
|
|
--
|
|
|
|
-- HOROLOGY
|
|
|
|
--
|
2003-07-29 02:03:19 +02:00
|
|
|
SET DateStyle = 'Postgres, MDY';
|
Prevent internal overflows in date-vs-timestamp and related comparisons.
The date-vs-timestamp, date-vs-timestamptz, and timestamp-vs-timestamptz
comparators all worked by promoting the first type to the second and
then doing a simple same-type comparison. This works fine, except
when the conversion result is out of range, in which case we throw an
entirely avoidable error. The sources of such failures are
(a) type date can represent dates much farther in the future than
the timestamp types can;
(b) timezone rotation might cause a just-in-range timestamp value to
become a just-out-of-range timestamptz value.
Up to now we just ignored these corner-case issues, but now we have
an actual user complaint (bug #16657 from Huss EL-Sheikh), so let's
do something about it.
It turns out that commit 52ad1e659 already built all the necessary
infrastructure to support error-free comparisons, but neglected to
actually use it in the main-line code paths. Fix that, do a little
bit of code style review, and remove the now-duplicate logic in
jsonpath_exec.c.
Back-patch to v13 where 52ad1e659 came in. We could take this back
further by back-patching said infrastructure, but given the small
number of complaints so far, I don't feel a great need to.
Discussion: https://postgr.es/m/16657-cde2f876d8cc7971@postgresql.org
2020-10-07 23:10:26 +02:00
|
|
|
SHOW TimeZone; -- Many of these tests depend on the prevailing setting
|
|
|
|
TimeZone
|
|
|
|
----------
|
|
|
|
PST8PDT
|
|
|
|
(1 row)
|
|
|
|
|
2002-01-12 05:38:38 +01:00
|
|
|
--
|
|
|
|
-- Test various input formats
|
|
|
|
--
|
|
|
|
SELECT timestamp with time zone '20011227 040506+08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Wed Dec 26 12:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '20011227 040506-08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Thu Dec 27 04:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '20011227 040506.789+08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Wed Dec 26 12:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '20011227 040506.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '20011227T040506+08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Wed Dec 26 12:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '20011227T040506-08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Thu Dec 27 04:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '20011227T040506.789+08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Wed Dec 26 12:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '20011227T040506.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '2001-12-27 04:05:06.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '2001.12.27 04:05:06.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '2001/12/27 04:05:06.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '12/27/2001 04:05:06.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
2023-03-16 19:18:28 +01:00
|
|
|
SELECT timestamp with time zone '2001-12-27 04:05:06.789 MET DST';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Wed Dec 26 18:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '2001-12-27 allballs';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Wed Dec 26 16:00:00 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
2003-07-29 02:03:19 +02:00
|
|
|
-- should fail in mdy mode:
|
|
|
|
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
|
2003-08-28 01:29:29 +02:00
|
|
|
ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08"
|
2008-09-01 22:42:46 +02:00
|
|
|
LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'...
|
|
|
|
^
|
2003-09-25 08:58:07 +02:00
|
|
|
HINT: Perhaps you need a different "datestyle" setting.
|
2003-07-29 02:03:19 +02:00
|
|
|
set datestyle to dmy;
|
2002-01-12 05:38:38 +01:00
|
|
|
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
2003-07-29 02:03:19 +02:00
|
|
|
Thu 27 Dec 04:05:06.789 2001 PST
|
2002-01-12 05:38:38 +01:00
|
|
|
(1 row)
|
|
|
|
|
2003-07-29 02:03:19 +02:00
|
|
|
reset datestyle;
|
2002-01-12 05:38:38 +01:00
|
|
|
SELECT timestamp with time zone 'J2452271+08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Wed Dec 26 08:00:00 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271-08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Thu Dec 27 00:00:00 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271.5+08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Wed Dec 26 20:00:00 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271.5-08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Thu Dec 27 12:00:00 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271 04:05:06+08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Wed Dec 26 12:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271 04:05:06-08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Thu Dec 27 04:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271T040506+08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Wed Dec 26 12:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271T040506-08';
|
|
|
|
timestamptz
|
|
|
|
------------------------------
|
|
|
|
Thu Dec 27 04:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271T040506.789+08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Wed Dec 26 12:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone 'J2452271T040506.789-08';
|
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- German/European-style dates with periods as delimiters
|
2003-07-29 02:03:19 +02:00
|
|
|
SELECT timestamp with time zone '12.27.2001 04:05:06.789+08';
|
2002-01-12 05:38:38 +01:00
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Wed Dec 26 12:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
2003-07-29 02:03:19 +02:00
|
|
|
SELECT timestamp with time zone '12.27.2001 04:05:06.789-08';
|
2002-01-12 05:38:38 +01:00
|
|
|
timestamptz
|
|
|
|
----------------------------------
|
|
|
|
Thu Dec 27 04:05:06.789 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SET DateStyle = 'German';
|
|
|
|
SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
|
|
|
|
timestamptz
|
|
|
|
-----------------------------
|
|
|
|
26.12.2001 12:05:06.789 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
|
|
|
|
timestamptz
|
|
|
|
-----------------------------
|
|
|
|
27.12.2001 04:05:06.789 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SET DateStyle = 'ISO';
|
2003-01-31 02:08:08 +01:00
|
|
|
-- As of 7.4, allow time without time zone having a time zone specified
|
2002-01-12 05:38:38 +01:00
|
|
|
SELECT time without time zone '040506.789+08';
|
2005-09-08 18:49:04 +02:00
|
|
|
time
|
2005-05-27 23:31:23 +02:00
|
|
|
--------------
|
|
|
|
04:05:06.789
|
2003-01-31 02:08:08 +01:00
|
|
|
(1 row)
|
|
|
|
|
2002-01-12 05:38:38 +01:00
|
|
|
SELECT time without time zone '040506.789-08';
|
2005-09-08 18:49:04 +02:00
|
|
|
time
|
2005-05-27 23:31:23 +02:00
|
|
|
--------------
|
|
|
|
04:05:06.789
|
2003-01-31 02:08:08 +01:00
|
|
|
(1 row)
|
|
|
|
|
2002-01-12 05:38:38 +01:00
|
|
|
SELECT time without time zone 'T040506.789+08';
|
2005-09-08 18:49:04 +02:00
|
|
|
time
|
2005-05-27 23:31:23 +02:00
|
|
|
--------------
|
|
|
|
04:05:06.789
|
2003-01-31 02:08:08 +01:00
|
|
|
(1 row)
|
|
|
|
|
2002-01-12 05:38:38 +01:00
|
|
|
SELECT time without time zone 'T040506.789-08';
|
2005-09-08 18:49:04 +02:00
|
|
|
time
|
2005-05-27 23:31:23 +02:00
|
|
|
--------------
|
|
|
|
04:05:06.789
|
2003-01-31 02:08:08 +01:00
|
|
|
(1 row)
|
|
|
|
|
2002-01-12 05:38:38 +01:00
|
|
|
SELECT time with time zone '040506.789+08';
|
2005-09-08 18:49:04 +02:00
|
|
|
timetz
|
2005-05-27 23:31:23 +02:00
|
|
|
-----------------
|
|
|
|
04:05:06.789+08
|
2002-01-12 05:38:38 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time with time zone '040506.789-08';
|
2005-09-08 18:49:04 +02:00
|
|
|
timetz
|
2005-05-27 23:31:23 +02:00
|
|
|
-----------------
|
|
|
|
04:05:06.789-08
|
2002-01-12 05:38:38 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time with time zone 'T040506.789+08';
|
2005-09-08 18:49:04 +02:00
|
|
|
timetz
|
2005-05-27 23:31:23 +02:00
|
|
|
-----------------
|
|
|
|
04:05:06.789+08
|
2002-01-12 05:38:38 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time with time zone 'T040506.789-08';
|
2005-09-08 18:49:04 +02:00
|
|
|
timetz
|
2005-05-27 23:31:23 +02:00
|
|
|
-----------------
|
|
|
|
04:05:06.789-08
|
2002-01-12 05:38:38 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time with time zone 'T040506.789 +08';
|
2005-09-08 18:49:04 +02:00
|
|
|
timetz
|
2005-05-27 23:31:23 +02:00
|
|
|
-----------------
|
|
|
|
04:05:06.789+08
|
2002-01-12 05:38:38 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time with time zone 'T040506.789 -08';
|
2005-09-08 18:49:04 +02:00
|
|
|
timetz
|
2005-05-27 23:31:23 +02:00
|
|
|
-----------------
|
|
|
|
04:05:06.789-08
|
2002-01-12 05:38:38 +01:00
|
|
|
(1 row)
|
|
|
|
|
2023-03-16 19:18:28 +01:00
|
|
|
-- time with time zone should accept a date for DST resolution purposes
|
|
|
|
SELECT time with time zone 'T040506.789 America/Los_Angeles';
|
|
|
|
ERROR: invalid input syntax for type time with time zone: "T040506.789 America/Los_Angeles"
|
|
|
|
LINE 1: SELECT time with time zone 'T040506.789 America/Los_Angeles'...
|
|
|
|
^
|
|
|
|
SELECT time with time zone '2001-12-27 T040506.789 America/Los_Angeles';
|
|
|
|
timetz
|
|
|
|
-----------------
|
|
|
|
04:05:06.789-08
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time with time zone 'J2452271 T040506.789 America/Los_Angeles';
|
|
|
|
timetz
|
|
|
|
-----------------
|
|
|
|
04:05:06.789-08
|
|
|
|
(1 row)
|
|
|
|
|
2003-07-29 02:03:19 +02:00
|
|
|
SET DateStyle = 'Postgres, MDY';
|
2010-09-23 05:48:07 +02:00
|
|
|
-- Check Julian dates BC
|
|
|
|
SELECT date 'J1520447' AS "Confucius' Birthday";
|
|
|
|
Confucius' Birthday
|
|
|
|
---------------------
|
|
|
|
09-28-0551 BC
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT date 'J0' AS "Julian Epoch";
|
|
|
|
Julian Epoch
|
|
|
|
---------------
|
|
|
|
11-24-4714 BC
|
|
|
|
(1 row)
|
|
|
|
|
2023-03-16 19:18:28 +01:00
|
|
|
-- test error on dangling Julian units
|
|
|
|
SELECT date '1995-08-06 J J J';
|
|
|
|
ERROR: invalid input syntax for type date: "1995-08-06 J J J"
|
|
|
|
LINE 1: SELECT date '1995-08-06 J J J';
|
|
|
|
^
|
|
|
|
SELECT date 'J J 1520447';
|
|
|
|
ERROR: invalid input syntax for type date: "J J 1520447"
|
|
|
|
LINE 1: SELECT date 'J J 1520447';
|
|
|
|
^
|
|
|
|
-- We used to accept this input style, but it was based on a misreading
|
|
|
|
-- of ISO8601, and it was never documented anyway
|
|
|
|
SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789+08';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "Y2001M12D27H04M05S06.789+08"
|
|
|
|
LINE 1: SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789+08...
|
|
|
|
^
|
|
|
|
SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789-08';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "Y2001M12D27H04MM05S06.789-08"
|
|
|
|
LINE 1: SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789-0...
|
|
|
|
^
|
2023-03-09 22:49:03 +01:00
|
|
|
-- conflicting fields should throw errors
|
|
|
|
SELECT date '1995-08-06 epoch';
|
|
|
|
ERROR: invalid input syntax for type date: "1995-08-06 epoch"
|
|
|
|
LINE 1: SELECT date '1995-08-06 epoch';
|
|
|
|
^
|
|
|
|
SELECT date '1995-08-06 infinity';
|
|
|
|
ERROR: invalid input syntax for type date: "1995-08-06 infinity"
|
|
|
|
LINE 1: SELECT date '1995-08-06 infinity';
|
|
|
|
^
|
|
|
|
SELECT date '1995-08-06 -infinity';
|
|
|
|
ERROR: invalid input syntax for type date: "1995-08-06 -infinity"
|
|
|
|
LINE 1: SELECT date '1995-08-06 -infinity';
|
|
|
|
^
|
|
|
|
SELECT date 'today infinity';
|
|
|
|
ERROR: invalid input syntax for type date: "today infinity"
|
|
|
|
LINE 1: SELECT date 'today infinity';
|
|
|
|
^
|
|
|
|
SELECT date '-infinity infinity';
|
|
|
|
ERROR: invalid input syntax for type date: "-infinity infinity"
|
|
|
|
LINE 1: SELECT date '-infinity infinity';
|
|
|
|
^
|
|
|
|
SELECT timestamp '1995-08-06 epoch';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "1995-08-06 epoch"
|
|
|
|
LINE 1: SELECT timestamp '1995-08-06 epoch';
|
|
|
|
^
|
|
|
|
SELECT timestamp '1995-08-06 infinity';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "1995-08-06 infinity"
|
|
|
|
LINE 1: SELECT timestamp '1995-08-06 infinity';
|
|
|
|
^
|
|
|
|
SELECT timestamp '1995-08-06 -infinity';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "1995-08-06 -infinity"
|
|
|
|
LINE 1: SELECT timestamp '1995-08-06 -infinity';
|
|
|
|
^
|
|
|
|
SELECT timestamp 'epoch 01:01:01';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "epoch 01:01:01"
|
|
|
|
LINE 1: SELECT timestamp 'epoch 01:01:01';
|
|
|
|
^
|
|
|
|
SELECT timestamp 'infinity 01:01:01';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "infinity 01:01:01"
|
|
|
|
LINE 1: SELECT timestamp 'infinity 01:01:01';
|
|
|
|
^
|
|
|
|
SELECT timestamp '-infinity 01:01:01';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "-infinity 01:01:01"
|
|
|
|
LINE 1: SELECT timestamp '-infinity 01:01:01';
|
|
|
|
^
|
|
|
|
SELECT timestamp 'now epoch';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "now epoch"
|
|
|
|
LINE 1: SELECT timestamp 'now epoch';
|
|
|
|
^
|
|
|
|
SELECT timestamp '-infinity infinity';
|
|
|
|
ERROR: invalid input syntax for type timestamp: "-infinity infinity"
|
|
|
|
LINE 1: SELECT timestamp '-infinity infinity';
|
|
|
|
^
|
|
|
|
SELECT timestamptz '1995-08-06 epoch';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "1995-08-06 epoch"
|
|
|
|
LINE 1: SELECT timestamptz '1995-08-06 epoch';
|
|
|
|
^
|
|
|
|
SELECT timestamptz '1995-08-06 infinity';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "1995-08-06 infinity"
|
|
|
|
LINE 1: SELECT timestamptz '1995-08-06 infinity';
|
|
|
|
^
|
|
|
|
SELECT timestamptz '1995-08-06 -infinity';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "1995-08-06 -infinity"
|
|
|
|
LINE 1: SELECT timestamptz '1995-08-06 -infinity';
|
|
|
|
^
|
|
|
|
SELECT timestamptz 'epoch 01:01:01';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "epoch 01:01:01"
|
|
|
|
LINE 1: SELECT timestamptz 'epoch 01:01:01';
|
|
|
|
^
|
|
|
|
SELECT timestamptz 'infinity 01:01:01';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "infinity 01:01:01"
|
|
|
|
LINE 1: SELECT timestamptz 'infinity 01:01:01';
|
|
|
|
^
|
|
|
|
SELECT timestamptz '-infinity 01:01:01';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "-infinity 01:01:01"
|
|
|
|
LINE 1: SELECT timestamptz '-infinity 01:01:01';
|
|
|
|
^
|
|
|
|
SELECT timestamptz 'now epoch';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "now epoch"
|
|
|
|
LINE 1: SELECT timestamptz 'now epoch';
|
|
|
|
^
|
|
|
|
SELECT timestamptz '-infinity infinity';
|
|
|
|
ERROR: invalid input syntax for type timestamp with time zone: "-infinity infinity"
|
|
|
|
LINE 1: SELECT timestamptz '-infinity infinity';
|
|
|
|
^
|
2000-01-05 07:06:23 +01:00
|
|
|
--
|
2000-09-12 07:42:20 +02:00
|
|
|
-- date, time arithmetic
|
|
|
|
--
|
|
|
|
SELECT date '1981-02-03' + time '04:05:06' AS "Date + Time";
|
2001-09-28 10:00:11 +02:00
|
|
|
Date + Time
|
|
|
|
--------------------------
|
|
|
|
Tue Feb 03 04:05:06 1981
|
2000-09-12 07:42:20 +02:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
|
|
|
|
Date + Time PST
|
|
|
|
------------------------------
|
|
|
|
Sun Feb 03 04:05:06 1991 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
|
|
|
|
Date + Time UTC
|
|
|
|
------------------------------
|
|
|
|
Fri Feb 02 20:05:06 2001 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT date '1991-02-03' + interval '2 years' AS "Add Two Years";
|
2002-04-21 21:52:18 +02:00
|
|
|
Add Two Years
|
|
|
|
--------------------------
|
|
|
|
Wed Feb 03 00:00:00 1993
|
2000-09-12 07:42:20 +02:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT date '2001-12-13' - interval '2 years' AS "Subtract Two Years";
|
2002-04-21 21:52:18 +02:00
|
|
|
Subtract Two Years
|
|
|
|
--------------------------
|
|
|
|
Mon Dec 13 00:00:00 1999
|
2000-09-12 07:42:20 +02:00
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
-- subtract time from date should not make sense; use interval instead
|
2000-09-12 07:42:20 +02:00
|
|
|
SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
|
2002-04-21 21:52:18 +02:00
|
|
|
Subtract Time
|
|
|
|
--------------------------
|
|
|
|
Sat Feb 02 19:54:54 1991
|
2000-09-12 07:42:20 +02:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
|
2003-07-04 04:51:34 +02:00
|
|
|
ERROR: operator does not exist: date - time with time zone
|
2006-03-14 23:48:25 +01:00
|
|
|
LINE 1: SELECT date '1991-02-03' - time with time zone '04:05:06 UTC...
|
|
|
|
^
|
2017-08-23 19:56:59 +02:00
|
|
|
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
|
2000-09-12 07:42:20 +02:00
|
|
|
--
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
-- timestamp, interval arithmetic
|
2000-01-05 07:06:23 +01:00
|
|
|
--
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT timestamp without time zone '1996-03-01' - interval '1 second' AS "Feb 29";
|
|
|
|
Feb 29
|
|
|
|
--------------------------
|
|
|
|
Thu Feb 29 23:59:59 1996
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp without time zone '1999-03-01' - interval '1 second' AS "Feb 28";
|
|
|
|
Feb 28
|
|
|
|
--------------------------
|
|
|
|
Sun Feb 28 23:59:59 1999
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp without time zone '2000-03-01' - interval '1 second' AS "Feb 29";
|
|
|
|
Feb 29
|
|
|
|
--------------------------
|
|
|
|
Tue Feb 29 23:59:59 2000
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp without time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
|
|
|
|
Dec 31
|
|
|
|
--------------------------
|
|
|
|
Fri Dec 31 23:59:59 1999
|
|
|
|
(1 row)
|
|
|
|
|
2003-03-20 07:03:00 +01:00
|
|
|
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days' AS "Feb 23, 285506";
|
|
|
|
Feb 23, 285506
|
|
|
|
----------------------------
|
|
|
|
Fri Feb 23 00:00:00 285506
|
2003-07-04 04:51:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2003-03-20 07:03:00 +01:00
|
|
|
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
|
|
|
|
Jan 20, 288244
|
|
|
|
----------------------------
|
|
|
|
Sat Jan 20 00:00:00 288244
|
2003-07-04 04:51:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2003-03-20 07:03:00 +01:00
|
|
|
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
|
|
|
|
Dec 31, 294276
|
|
|
|
----------------------------
|
|
|
|
Sun Dec 31 00:00:00 294276
|
2003-07-04 04:51:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2024-01-26 19:39:37 +01:00
|
|
|
SELECT timestamp without time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
|
|
|
ERROR: timestamp out of range
|
2003-03-20 07:03:00 +01:00
|
|
|
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
|
|
|
|
106751991 Days
|
|
|
|
------------------
|
|
|
|
@ 106751991 days
|
2003-02-19 04:48:11 +01:00
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
-- Shorthand values
|
|
|
|
-- Not directly usable for regression testing since these are not constants.
|
|
|
|
-- So, just try to test parser and hope for the best - thomas 97/04/26
|
|
|
|
SELECT (timestamp without time zone 'today' = (timestamp without time zone 'yesterday' + interval '1 day')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone 'today' = (timestamp without time zone 'tomorrow' - interval '1 day')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2011-08-30 17:34:29 +02:00
|
|
|
SELECT (timestamp without time zone 'today 10:30' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '10:30 today' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp without time zone 'tomorrow' = (timestamp without time zone 'yesterday' + interval '2 days')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2011-08-30 17:34:29 +02:00
|
|
|
SELECT (timestamp without time zone 'tomorrow 16:00:00' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '16:00:00 tomorrow' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone 'yesterday 12:34:56' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '12:34:56 yesterday' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp without time zone 'tomorrow' > 'now') as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2001-10-03 07:29:27 +02:00
|
|
|
-- Convert from date and time to timestamp
|
|
|
|
-- This test used to be timestamp(date,time) but no longer allowed by grammar
|
|
|
|
-- to enable support for SQL99 timestamp type syntax.
|
|
|
|
SELECT date '1994-01-01' + time '11:00' AS "Jan_01_1994_11am";
|
2001-09-28 10:00:11 +02:00
|
|
|
Jan_01_1994_11am
|
|
|
|
--------------------------
|
|
|
|
Sat Jan 01 11:00:00 1994
|
|
|
|
(1 row)
|
|
|
|
|
2001-10-03 07:29:27 +02:00
|
|
|
SELECT date '1994-01-01' + time '10:00' AS "Jan_01_1994_10am";
|
2001-09-28 10:00:11 +02:00
|
|
|
Jan_01_1994_10am
|
|
|
|
--------------------------
|
|
|
|
Sat Jan 01 10:00:00 1994
|
|
|
|
(1 row)
|
|
|
|
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
SELECT date '1994-01-01' + timetz '11:00-5' AS "Jan_01_1994_8am";
|
|
|
|
Jan_01_1994_8am
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 08:00:00 1994 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
|
|
|
|
Jan_01_1994_8am
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 08:00:00 1994 PST
|
2001-09-28 10:00:11 +02:00
|
|
|
(1 row)
|
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMP_TBL;
|
|
|
|
one_year
|
|
|
|
-----------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
Fri Jan 01 00:00:00 1971
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:02 1998
|
|
|
|
Tue Feb 10 17:32:01.4 1998
|
|
|
|
Tue Feb 10 17:32:01.5 1998
|
|
|
|
Tue Feb 10 17:32:01.6 1998
|
|
|
|
Fri Jan 02 00:00:00 1998
|
|
|
|
Fri Jan 02 03:04:05 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Wed Jun 10 17:32:01 1998
|
|
|
|
Sun Sep 22 18:19:20 2002
|
|
|
|
Thu Mar 15 08:14:01 2001
|
|
|
|
Thu Mar 15 13:14:02 2001
|
|
|
|
Thu Mar 15 12:14:03 2001
|
|
|
|
Thu Mar 15 03:14:04 2001
|
|
|
|
Thu Mar 15 02:14:05 2001
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:00 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Wed Jun 10 18:32:01 1998
|
|
|
|
Tue Feb 10 17:32:01 1998
|
|
|
|
Wed Feb 11 17:32:01 1998
|
|
|
|
Thu Feb 12 17:32:01 1998
|
|
|
|
Fri Feb 13 17:32:01 1998
|
|
|
|
Sat Feb 14 17:32:01 1998
|
|
|
|
Sun Feb 15 17:32:01 1998
|
|
|
|
Mon Feb 16 17:32:01 1998
|
|
|
|
Thu Feb 16 17:32:01 0096 BC
|
|
|
|
Sun Feb 16 17:32:01 0098
|
|
|
|
Fri Feb 16 17:32:01 0598
|
|
|
|
Wed Feb 16 17:32:01 1098
|
|
|
|
Sun Feb 16 17:32:01 1698
|
|
|
|
Fri Feb 16 17:32:01 1798
|
|
|
|
Wed Feb 16 17:32:01 1898
|
|
|
|
Mon Feb 16 17:32:01 1998
|
|
|
|
Sun Feb 16 17:32:01 2098
|
|
|
|
Fri Feb 28 17:32:01 1997
|
|
|
|
Fri Feb 28 17:32:01 1997
|
|
|
|
Sat Mar 01 17:32:01 1997
|
|
|
|
Tue Dec 30 17:32:01 1997
|
|
|
|
Wed Dec 31 17:32:01 1997
|
|
|
|
Thu Jan 01 17:32:01 1998
|
|
|
|
Sat Feb 28 17:32:01 1998
|
|
|
|
Sun Mar 01 17:32:01 1998
|
|
|
|
Wed Dec 30 17:32:01 1998
|
|
|
|
Thu Dec 31 17:32:01 1998
|
|
|
|
Sun Dec 31 17:32:01 2000
|
|
|
|
Mon Jan 01 17:32:01 2001
|
|
|
|
Mon Dec 31 17:32:01 2001
|
|
|
|
Tue Jan 01 17:32:01 2002
|
2006-07-06 03:46:38 +02:00
|
|
|
(65 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMP_TBL;
|
|
|
|
one_year
|
|
|
|
-----------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
Wed Jan 01 00:00:00 1969
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:02 1996
|
|
|
|
Sat Feb 10 17:32:01.4 1996
|
|
|
|
Sat Feb 10 17:32:01.5 1996
|
|
|
|
Sat Feb 10 17:32:01.6 1996
|
|
|
|
Tue Jan 02 00:00:00 1996
|
|
|
|
Tue Jan 02 03:04:05 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Mon Jun 10 17:32:01 1996
|
|
|
|
Fri Sep 22 18:19:20 2000
|
|
|
|
Mon Mar 15 08:14:01 1999
|
|
|
|
Mon Mar 15 13:14:02 1999
|
|
|
|
Mon Mar 15 12:14:03 1999
|
|
|
|
Mon Mar 15 03:14:04 1999
|
|
|
|
Mon Mar 15 02:14:05 1999
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:00 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Mon Jun 10 18:32:01 1996
|
|
|
|
Sat Feb 10 17:32:01 1996
|
|
|
|
Sun Feb 11 17:32:01 1996
|
|
|
|
Mon Feb 12 17:32:01 1996
|
|
|
|
Tue Feb 13 17:32:01 1996
|
|
|
|
Wed Feb 14 17:32:01 1996
|
|
|
|
Thu Feb 15 17:32:01 1996
|
|
|
|
Fri Feb 16 17:32:01 1996
|
|
|
|
Mon Feb 16 17:32:01 0098 BC
|
|
|
|
Thu Feb 16 17:32:01 0096
|
|
|
|
Tue Feb 16 17:32:01 0596
|
|
|
|
Sun Feb 16 17:32:01 1096
|
|
|
|
Thu Feb 16 17:32:01 1696
|
|
|
|
Tue Feb 16 17:32:01 1796
|
|
|
|
Sun Feb 16 17:32:01 1896
|
|
|
|
Fri Feb 16 17:32:01 1996
|
|
|
|
Thu Feb 16 17:32:01 2096
|
|
|
|
Tue Feb 28 17:32:01 1995
|
|
|
|
Tue Feb 28 17:32:01 1995
|
|
|
|
Wed Mar 01 17:32:01 1995
|
|
|
|
Sat Dec 30 17:32:01 1995
|
|
|
|
Sun Dec 31 17:32:01 1995
|
|
|
|
Mon Jan 01 17:32:01 1996
|
|
|
|
Wed Feb 28 17:32:01 1996
|
|
|
|
Fri Mar 01 17:32:01 1996
|
|
|
|
Mon Dec 30 17:32:01 1996
|
|
|
|
Tue Dec 31 17:32:01 1996
|
|
|
|
Thu Dec 31 17:32:01 1998
|
|
|
|
Fri Jan 01 17:32:01 1999
|
|
|
|
Fri Dec 31 17:32:01 1999
|
|
|
|
Sat Jan 01 17:32:01 2000
|
2006-07-06 03:46:38 +02:00
|
|
|
(65 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
|
|
|
SELECT timestamp with time zone '1996-03-01' - interval '1 second' AS "Feb 29";
|
2000-01-05 07:06:23 +01:00
|
|
|
Feb 29
|
|
|
|
------------------------------
|
|
|
|
Thu Feb 29 23:59:59 1996 PST
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT timestamp with time zone '1999-03-01' - interval '1 second' AS "Feb 28";
|
2000-01-05 07:06:23 +01:00
|
|
|
Feb 28
|
|
|
|
------------------------------
|
|
|
|
Sun Feb 28 23:59:59 1999 PST
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT timestamp with time zone '2000-03-01' - interval '1 second' AS "Feb 29";
|
2000-01-05 07:06:23 +01:00
|
|
|
Feb 29
|
|
|
|
------------------------------
|
|
|
|
Tue Feb 29 23:59:59 2000 PST
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
|
2000-01-05 07:06:23 +01:00
|
|
|
Dec 31
|
|
|
|
------------------------------
|
|
|
|
Fri Dec 31 23:59:59 1999 PST
|
|
|
|
(1 row)
|
|
|
|
|
2024-01-26 19:39:37 +01:00
|
|
|
SELECT timestamp with time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
|
|
|
ERROR: timestamp out of range
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2005-07-30 16:52:04 +02:00
|
|
|
-- timestamp with time zone, interval arithmetic around DST change
|
Future-proof regression tests against possibly-missing posixrules file.
The IANA time zone folk have deprecated use of a "posixrules" file in
the tz database. While for now it's our choice whether to keep
supplying one in our own builds, installations built with
--with-system-tzdata will soon be needing to cope with that file not
being present, at least on some platforms.
This causes a problem for the horology test, which expected the
nonstandard POSIX zone spec "CST7CDT" to apply pre-2007 US daylight
savings rules. That does happen if the posixrules file supplies such
information, but otherwise the test produces undesired results.
To fix, add an explicit transition date rule that matches 2005 practice.
(We could alternatively have switched the test to use some real time
zone, but it seems useful to have coverage of this type of zone spec.)
While at it, update a documentation example that also relied on
"CST7CDT"; use a real-world zone name instead. Also, document why
the zone names EST5EDT, CST6CDT, MST7MDT, PST8PDT aren't subject to
similar failures when "posixrules" is missing.
Back-patch to all supported branches, since the hazard is the same
for all.
Discussion: https://postgr.es/m/1665379.1592581287@sss.pgh.pa.us
2020-06-19 19:55:21 +02:00
|
|
|
-- (just for fun, let's use an intentionally nonstandard POSIX zone spec)
|
|
|
|
SET TIME ZONE 'CST7CDT,M4.1.0,M10.5.0';
|
2005-07-30 16:52:04 +02:00
|
|
|
SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' as "Apr 3, 12:00";
|
|
|
|
Apr 3, 12:00
|
|
|
|
------------------------------
|
|
|
|
Sun Apr 03 12:00:00 2005 CDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '24 hours' as "Apr 3, 13:00";
|
|
|
|
Apr 3, 13:00
|
|
|
|
------------------------------
|
|
|
|
Sun Apr 03 13:00:00 2005 CDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '1 day' as "Apr 2, 12:00";
|
|
|
|
Apr 2, 12:00
|
|
|
|
------------------------------
|
|
|
|
Sat Apr 02 12:00:00 2005 CST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '24 hours' as "Apr 2, 11:00";
|
|
|
|
Apr 2, 11:00
|
|
|
|
------------------------------
|
|
|
|
Sat Apr 02 11:00:00 2005 CST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
RESET TIME ZONE;
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT timestamptz(date '1994-01-01', time '11:00') AS "Jan_01_1994_10am";
|
|
|
|
Jan_01_1994_10am
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 11:00:00 1994 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamptz(date '1994-01-01', time '10:00') AS "Jan_01_1994_9am";
|
|
|
|
Jan_01_1994_9am
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 10:00:00 1994 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamptz(date '1994-01-01', time with time zone '11:00-8') AS "Jan_01_1994_11am";
|
|
|
|
Jan_01_1994_11am
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 11:00:00 1994 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamptz(date '1994-01-01', time with time zone '10:00-8') AS "Jan_01_1994_10am";
|
|
|
|
Jan_01_1994_10am
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 10:00:00 1994 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
|
|
|
|
Jan_01_1994_8am
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 08:00:00 1994 PST
|
|
|
|
(1 row)
|
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
|
|
|
|
one_year
|
|
|
|
---------------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
Thu Dec 31 16:00:00 1970 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:02 1998 PST
|
|
|
|
Tue Feb 10 17:32:01.4 1998 PST
|
|
|
|
Tue Feb 10 17:32:01.5 1998 PST
|
|
|
|
Tue Feb 10 17:32:01.6 1998 PST
|
|
|
|
Fri Jan 02 00:00:00 1998 PST
|
|
|
|
Fri Jan 02 03:04:05 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Wed Jun 10 17:32:01 1998 PDT
|
|
|
|
Sun Sep 22 18:19:20 2002 PDT
|
|
|
|
Thu Mar 15 08:14:01 2001 PST
|
|
|
|
Thu Mar 15 04:14:02 2001 PST
|
|
|
|
Thu Mar 15 02:14:03 2001 PST
|
|
|
|
Thu Mar 15 03:14:04 2001 PST
|
|
|
|
Thu Mar 15 01:14:05 2001 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:00 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Tue Feb 10 09:32:01 1998 PST
|
|
|
|
Tue Feb 10 09:32:01 1998 PST
|
|
|
|
Tue Feb 10 09:32:01 1998 PST
|
|
|
|
Tue Feb 10 14:32:01 1998 PST
|
|
|
|
Fri Jul 10 14:32:01 1998 PDT
|
|
|
|
Wed Jun 10 18:32:01 1998 PDT
|
|
|
|
Tue Feb 10 17:32:01 1998 PST
|
|
|
|
Wed Feb 11 17:32:01 1998 PST
|
|
|
|
Thu Feb 12 17:32:01 1998 PST
|
|
|
|
Fri Feb 13 17:32:01 1998 PST
|
|
|
|
Sat Feb 14 17:32:01 1998 PST
|
|
|
|
Sun Feb 15 17:32:01 1998 PST
|
|
|
|
Mon Feb 16 17:32:01 1998 PST
|
|
|
|
Thu Feb 16 17:32:01 0096 PST BC
|
|
|
|
Sun Feb 16 17:32:01 0098 PST
|
|
|
|
Fri Feb 16 17:32:01 0598 PST
|
|
|
|
Wed Feb 16 17:32:01 1098 PST
|
|
|
|
Sun Feb 16 17:32:01 1698 PST
|
|
|
|
Fri Feb 16 17:32:01 1798 PST
|
|
|
|
Wed Feb 16 17:32:01 1898 PST
|
|
|
|
Mon Feb 16 17:32:01 1998 PST
|
|
|
|
Sun Feb 16 17:32:01 2098 PST
|
|
|
|
Fri Feb 28 17:32:01 1997 PST
|
|
|
|
Fri Feb 28 17:32:01 1997 PST
|
|
|
|
Sat Mar 01 17:32:01 1997 PST
|
|
|
|
Tue Dec 30 17:32:01 1997 PST
|
|
|
|
Wed Dec 31 17:32:01 1997 PST
|
|
|
|
Thu Jan 01 17:32:01 1998 PST
|
|
|
|
Sat Feb 28 17:32:01 1998 PST
|
|
|
|
Sun Mar 01 17:32:01 1998 PST
|
|
|
|
Wed Dec 30 17:32:01 1998 PST
|
|
|
|
Thu Dec 31 17:32:01 1998 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST
|
|
|
|
Mon Dec 31 17:32:01 2001 PST
|
|
|
|
Tue Jan 01 17:32:01 2002 PST
|
2006-07-06 03:46:38 +02:00
|
|
|
(66 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
|
|
|
|
one_year
|
|
|
|
---------------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
Tue Dec 31 16:00:00 1968 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:02 1996 PST
|
|
|
|
Sat Feb 10 17:32:01.4 1996 PST
|
|
|
|
Sat Feb 10 17:32:01.5 1996 PST
|
|
|
|
Sat Feb 10 17:32:01.6 1996 PST
|
|
|
|
Tue Jan 02 00:00:00 1996 PST
|
|
|
|
Tue Jan 02 03:04:05 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Mon Jun 10 17:32:01 1996 PDT
|
|
|
|
Fri Sep 22 18:19:20 2000 PDT
|
|
|
|
Mon Mar 15 08:14:01 1999 PST
|
|
|
|
Mon Mar 15 04:14:02 1999 PST
|
|
|
|
Mon Mar 15 02:14:03 1999 PST
|
|
|
|
Mon Mar 15 03:14:04 1999 PST
|
|
|
|
Mon Mar 15 01:14:05 1999 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:00 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sat Feb 10 09:32:01 1996 PST
|
|
|
|
Sat Feb 10 09:32:01 1996 PST
|
|
|
|
Sat Feb 10 09:32:01 1996 PST
|
|
|
|
Sat Feb 10 14:32:01 1996 PST
|
|
|
|
Wed Jul 10 14:32:01 1996 PDT
|
|
|
|
Mon Jun 10 18:32:01 1996 PDT
|
|
|
|
Sat Feb 10 17:32:01 1996 PST
|
|
|
|
Sun Feb 11 17:32:01 1996 PST
|
|
|
|
Mon Feb 12 17:32:01 1996 PST
|
|
|
|
Tue Feb 13 17:32:01 1996 PST
|
|
|
|
Wed Feb 14 17:32:01 1996 PST
|
|
|
|
Thu Feb 15 17:32:01 1996 PST
|
|
|
|
Fri Feb 16 17:32:01 1996 PST
|
|
|
|
Mon Feb 16 17:32:01 0098 PST BC
|
|
|
|
Thu Feb 16 17:32:01 0096 PST
|
|
|
|
Tue Feb 16 17:32:01 0596 PST
|
|
|
|
Sun Feb 16 17:32:01 1096 PST
|
|
|
|
Thu Feb 16 17:32:01 1696 PST
|
|
|
|
Tue Feb 16 17:32:01 1796 PST
|
|
|
|
Sun Feb 16 17:32:01 1896 PST
|
|
|
|
Fri Feb 16 17:32:01 1996 PST
|
|
|
|
Thu Feb 16 17:32:01 2096 PST
|
|
|
|
Tue Feb 28 17:32:01 1995 PST
|
|
|
|
Tue Feb 28 17:32:01 1995 PST
|
|
|
|
Wed Mar 01 17:32:01 1995 PST
|
|
|
|
Sat Dec 30 17:32:01 1995 PST
|
|
|
|
Sun Dec 31 17:32:01 1995 PST
|
|
|
|
Mon Jan 01 17:32:01 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST
|
|
|
|
Thu Dec 31 17:32:01 1998 PST
|
|
|
|
Fri Jan 01 17:32:01 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST
|
2006-07-06 03:46:38 +02:00
|
|
|
(66 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2000-12-03 15:51:12 +01:00
|
|
|
--
|
|
|
|
-- time, interval arithmetic
|
|
|
|
--
|
|
|
|
SELECT CAST(time '01:02' AS interval) AS "+01:02";
|
|
|
|
+01:02
|
|
|
|
-----------------
|
|
|
|
@ 1 hour 2 mins
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT CAST(interval '02:03' AS time) AS "02:03:00";
|
|
|
|
02:03:00
|
|
|
|
----------
|
|
|
|
02:03:00
|
|
|
|
(1 row)
|
|
|
|
|
2023-11-09 13:10:14 +01:00
|
|
|
SELECT CAST(interval '-02:03' AS time) AS "21:57:00";
|
|
|
|
21:57:00
|
|
|
|
----------
|
|
|
|
21:57:00
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT CAST(interval '-9223372022400000000 us' AS time) AS "00:00:00";
|
|
|
|
00:00:00
|
|
|
|
----------
|
|
|
|
00:00:00
|
|
|
|
(1 row)
|
|
|
|
|
2000-12-03 15:51:12 +01:00
|
|
|
SELECT time '01:30' + interval '02:01' AS "03:31:00";
|
|
|
|
03:31:00
|
|
|
|
----------
|
|
|
|
03:31:00
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time '01:30' - interval '02:01' AS "23:29:00";
|
|
|
|
23:29:00
|
|
|
|
----------
|
|
|
|
23:29:00
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time '02:30' + interval '36:01' AS "14:31:00";
|
|
|
|
14:31:00
|
|
|
|
----------
|
|
|
|
14:31:00
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time '03:30' + interval '1 month 04:01' AS "07:31:00";
|
|
|
|
07:31:00
|
|
|
|
----------
|
|
|
|
07:31:00
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
|
2003-07-19 22:20:53 +02:00
|
|
|
ERROR: cannot cast type time with time zone to interval
|
2006-12-30 22:21:56 +01:00
|
|
|
LINE 1: SELECT CAST(time with time zone '01:02-08' AS interval) AS "...
|
2008-09-01 22:42:46 +02:00
|
|
|
^
|
2000-12-03 15:51:12 +01:00
|
|
|
SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
|
2003-07-19 22:20:53 +02:00
|
|
|
ERROR: cannot cast type interval to time with time zone
|
2006-12-30 22:21:56 +01:00
|
|
|
LINE 1: SELECT CAST(interval '02:03' AS time with time zone) AS "02:...
|
2008-09-01 22:42:46 +02:00
|
|
|
^
|
2000-12-03 15:51:12 +01:00
|
|
|
SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08";
|
|
|
|
23:29:00-08
|
|
|
|
-------------
|
|
|
|
23:29:00-08
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
|
|
|
|
14:31:00-08
|
|
|
|
-------------
|
|
|
|
14:31:00-08
|
|
|
|
(1 row)
|
|
|
|
|
2001-04-04 22:03:11 +02:00
|
|
|
-- These two tests cannot be used because they default to current timezone,
|
|
|
|
-- which may be either -08 or -07 depending on the time of year.
|
|
|
|
-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
|
|
|
|
-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
|
2001-04-06 07:50:29 +02:00
|
|
|
-- Try the following two tests instead, as a poor substitute
|
2006-04-02 21:39:54 +02:00
|
|
|
SELECT CAST(CAST(date 'today' + time with time zone '05:30'
|
|
|
|
+ interval '02:01' AS time with time zone) AS time) AS "07:31:00";
|
|
|
|
07:31:00
|
2001-04-06 07:50:29 +02:00
|
|
|
----------
|
2006-04-02 21:39:54 +02:00
|
|
|
07:31:00
|
2001-04-06 07:50:29 +02:00
|
|
|
(1 row)
|
|
|
|
|
2001-11-06 17:31:13 +01:00
|
|
|
SELECT CAST(cast(date 'today' + time with time zone '03:30'
|
2001-09-29 17:17:42 +02:00
|
|
|
+ interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00";
|
2001-04-06 07:50:29 +02:00
|
|
|
07:31:00
|
|
|
|
----------
|
|
|
|
07:31:00
|
|
|
|
(1 row)
|
|
|
|
|
2007-07-25 19:22:37 +02:00
|
|
|
SELECT t.d1 AS t, i.f1 AS i, t.d1 + i.f1 AS "add", t.d1 - i.f1 AS "subtract"
|
|
|
|
FROM TIMESTAMP_TBL t, INTERVAL_TBL i
|
2000-12-03 15:51:12 +01:00
|
|
|
WHERE t.d1 BETWEEN '1990-01-01' AND '2001-01-01'
|
2007-07-25 19:22:37 +02:00
|
|
|
AND i.f1 BETWEEN '00:00' AND '23:00'
|
|
|
|
ORDER BY 1,2;
|
2008-11-12 02:36:20 +01:00
|
|
|
t | i | add | subtract
|
|
|
|
----------------------------+-----------+----------------------------+----------------------------
|
|
|
|
Wed Feb 28 17:32:01 1996 | @ 1 min | Wed Feb 28 17:33:01 1996 | Wed Feb 28 17:31:01 1996
|
|
|
|
Wed Feb 28 17:32:01 1996 | @ 5 hours | Wed Feb 28 22:32:01 1996 | Wed Feb 28 12:32:01 1996
|
|
|
|
Thu Feb 29 17:32:01 1996 | @ 1 min | Thu Feb 29 17:33:01 1996 | Thu Feb 29 17:31:01 1996
|
|
|
|
Thu Feb 29 17:32:01 1996 | @ 5 hours | Thu Feb 29 22:32:01 1996 | Thu Feb 29 12:32:01 1996
|
|
|
|
Fri Mar 01 17:32:01 1996 | @ 1 min | Fri Mar 01 17:33:01 1996 | Fri Mar 01 17:31:01 1996
|
|
|
|
Fri Mar 01 17:32:01 1996 | @ 5 hours | Fri Mar 01 22:32:01 1996 | Fri Mar 01 12:32:01 1996
|
|
|
|
Mon Dec 30 17:32:01 1996 | @ 1 min | Mon Dec 30 17:33:01 1996 | Mon Dec 30 17:31:01 1996
|
|
|
|
Mon Dec 30 17:32:01 1996 | @ 5 hours | Mon Dec 30 22:32:01 1996 | Mon Dec 30 12:32:01 1996
|
|
|
|
Tue Dec 31 17:32:01 1996 | @ 1 min | Tue Dec 31 17:33:01 1996 | Tue Dec 31 17:31:01 1996
|
|
|
|
Tue Dec 31 17:32:01 1996 | @ 5 hours | Tue Dec 31 22:32:01 1996 | Tue Dec 31 12:32:01 1996
|
|
|
|
Wed Jan 01 17:32:01 1997 | @ 1 min | Wed Jan 01 17:33:01 1997 | Wed Jan 01 17:31:01 1997
|
|
|
|
Wed Jan 01 17:32:01 1997 | @ 5 hours | Wed Jan 01 22:32:01 1997 | Wed Jan 01 12:32:01 1997
|
|
|
|
Thu Jan 02 00:00:00 1997 | @ 1 min | Thu Jan 02 00:01:00 1997 | Wed Jan 01 23:59:00 1997
|
|
|
|
Thu Jan 02 00:00:00 1997 | @ 5 hours | Thu Jan 02 05:00:00 1997 | Wed Jan 01 19:00:00 1997
|
|
|
|
Thu Jan 02 03:04:05 1997 | @ 1 min | Thu Jan 02 03:05:05 1997 | Thu Jan 02 03:03:05 1997
|
|
|
|
Thu Jan 02 03:04:05 1997 | @ 5 hours | Thu Jan 02 08:04:05 1997 | Wed Jan 01 22:04:05 1997
|
|
|
|
Mon Feb 10 17:32:00 1997 | @ 1 min | Mon Feb 10 17:33:00 1997 | Mon Feb 10 17:31:00 1997
|
|
|
|
Mon Feb 10 17:32:00 1997 | @ 5 hours | Mon Feb 10 22:32:00 1997 | Mon Feb 10 12:32:00 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01.4 1997 | @ 1 min | Mon Feb 10 17:33:01.4 1997 | Mon Feb 10 17:31:01.4 1997
|
|
|
|
Mon Feb 10 17:32:01.4 1997 | @ 5 hours | Mon Feb 10 22:32:01.4 1997 | Mon Feb 10 12:32:01.4 1997
|
|
|
|
Mon Feb 10 17:32:01.5 1997 | @ 1 min | Mon Feb 10 17:33:01.5 1997 | Mon Feb 10 17:31:01.5 1997
|
|
|
|
Mon Feb 10 17:32:01.5 1997 | @ 5 hours | Mon Feb 10 22:32:01.5 1997 | Mon Feb 10 12:32:01.5 1997
|
|
|
|
Mon Feb 10 17:32:01.6 1997 | @ 1 min | Mon Feb 10 17:33:01.6 1997 | Mon Feb 10 17:31:01.6 1997
|
|
|
|
Mon Feb 10 17:32:01.6 1997 | @ 5 hours | Mon Feb 10 22:32:01.6 1997 | Mon Feb 10 12:32:01.6 1997
|
|
|
|
Mon Feb 10 17:32:02 1997 | @ 1 min | Mon Feb 10 17:33:02 1997 | Mon Feb 10 17:31:02 1997
|
|
|
|
Mon Feb 10 17:32:02 1997 | @ 5 hours | Mon Feb 10 22:32:02 1997 | Mon Feb 10 12:32:02 1997
|
|
|
|
Tue Feb 11 17:32:01 1997 | @ 1 min | Tue Feb 11 17:33:01 1997 | Tue Feb 11 17:31:01 1997
|
|
|
|
Tue Feb 11 17:32:01 1997 | @ 5 hours | Tue Feb 11 22:32:01 1997 | Tue Feb 11 12:32:01 1997
|
|
|
|
Wed Feb 12 17:32:01 1997 | @ 1 min | Wed Feb 12 17:33:01 1997 | Wed Feb 12 17:31:01 1997
|
|
|
|
Wed Feb 12 17:32:01 1997 | @ 5 hours | Wed Feb 12 22:32:01 1997 | Wed Feb 12 12:32:01 1997
|
|
|
|
Thu Feb 13 17:32:01 1997 | @ 1 min | Thu Feb 13 17:33:01 1997 | Thu Feb 13 17:31:01 1997
|
|
|
|
Thu Feb 13 17:32:01 1997 | @ 5 hours | Thu Feb 13 22:32:01 1997 | Thu Feb 13 12:32:01 1997
|
|
|
|
Fri Feb 14 17:32:01 1997 | @ 1 min | Fri Feb 14 17:33:01 1997 | Fri Feb 14 17:31:01 1997
|
|
|
|
Fri Feb 14 17:32:01 1997 | @ 5 hours | Fri Feb 14 22:32:01 1997 | Fri Feb 14 12:32:01 1997
|
|
|
|
Sat Feb 15 17:32:01 1997 | @ 1 min | Sat Feb 15 17:33:01 1997 | Sat Feb 15 17:31:01 1997
|
|
|
|
Sat Feb 15 17:32:01 1997 | @ 5 hours | Sat Feb 15 22:32:01 1997 | Sat Feb 15 12:32:01 1997
|
|
|
|
Sun Feb 16 17:32:01 1997 | @ 1 min | Sun Feb 16 17:33:01 1997 | Sun Feb 16 17:31:01 1997
|
|
|
|
Sun Feb 16 17:32:01 1997 | @ 1 min | Sun Feb 16 17:33:01 1997 | Sun Feb 16 17:31:01 1997
|
|
|
|
Sun Feb 16 17:32:01 1997 | @ 5 hours | Sun Feb 16 22:32:01 1997 | Sun Feb 16 12:32:01 1997
|
|
|
|
Sun Feb 16 17:32:01 1997 | @ 5 hours | Sun Feb 16 22:32:01 1997 | Sun Feb 16 12:32:01 1997
|
|
|
|
Fri Feb 28 17:32:01 1997 | @ 1 min | Fri Feb 28 17:33:01 1997 | Fri Feb 28 17:31:01 1997
|
|
|
|
Fri Feb 28 17:32:01 1997 | @ 5 hours | Fri Feb 28 22:32:01 1997 | Fri Feb 28 12:32:01 1997
|
|
|
|
Sat Mar 01 17:32:01 1997 | @ 1 min | Sat Mar 01 17:33:01 1997 | Sat Mar 01 17:31:01 1997
|
|
|
|
Sat Mar 01 17:32:01 1997 | @ 5 hours | Sat Mar 01 22:32:01 1997 | Sat Mar 01 12:32:01 1997
|
|
|
|
Tue Jun 10 17:32:01 1997 | @ 1 min | Tue Jun 10 17:33:01 1997 | Tue Jun 10 17:31:01 1997
|
|
|
|
Tue Jun 10 17:32:01 1997 | @ 5 hours | Tue Jun 10 22:32:01 1997 | Tue Jun 10 12:32:01 1997
|
|
|
|
Tue Jun 10 18:32:01 1997 | @ 1 min | Tue Jun 10 18:33:01 1997 | Tue Jun 10 18:31:01 1997
|
|
|
|
Tue Jun 10 18:32:01 1997 | @ 5 hours | Tue Jun 10 23:32:01 1997 | Tue Jun 10 13:32:01 1997
|
|
|
|
Tue Dec 30 17:32:01 1997 | @ 1 min | Tue Dec 30 17:33:01 1997 | Tue Dec 30 17:31:01 1997
|
|
|
|
Tue Dec 30 17:32:01 1997 | @ 5 hours | Tue Dec 30 22:32:01 1997 | Tue Dec 30 12:32:01 1997
|
|
|
|
Wed Dec 31 17:32:01 1997 | @ 1 min | Wed Dec 31 17:33:01 1997 | Wed Dec 31 17:31:01 1997
|
|
|
|
Wed Dec 31 17:32:01 1997 | @ 5 hours | Wed Dec 31 22:32:01 1997 | Wed Dec 31 12:32:01 1997
|
|
|
|
Fri Dec 31 17:32:01 1999 | @ 1 min | Fri Dec 31 17:33:01 1999 | Fri Dec 31 17:31:01 1999
|
|
|
|
Fri Dec 31 17:32:01 1999 | @ 5 hours | Fri Dec 31 22:32:01 1999 | Fri Dec 31 12:32:01 1999
|
|
|
|
Sat Jan 01 17:32:01 2000 | @ 1 min | Sat Jan 01 17:33:01 2000 | Sat Jan 01 17:31:01 2000
|
|
|
|
Sat Jan 01 17:32:01 2000 | @ 5 hours | Sat Jan 01 22:32:01 2000 | Sat Jan 01 12:32:01 2000
|
|
|
|
Wed Mar 15 02:14:05 2000 | @ 1 min | Wed Mar 15 02:15:05 2000 | Wed Mar 15 02:13:05 2000
|
|
|
|
Wed Mar 15 02:14:05 2000 | @ 5 hours | Wed Mar 15 07:14:05 2000 | Tue Mar 14 21:14:05 2000
|
|
|
|
Wed Mar 15 03:14:04 2000 | @ 1 min | Wed Mar 15 03:15:04 2000 | Wed Mar 15 03:13:04 2000
|
|
|
|
Wed Mar 15 03:14:04 2000 | @ 5 hours | Wed Mar 15 08:14:04 2000 | Tue Mar 14 22:14:04 2000
|
|
|
|
Wed Mar 15 08:14:01 2000 | @ 1 min | Wed Mar 15 08:15:01 2000 | Wed Mar 15 08:13:01 2000
|
|
|
|
Wed Mar 15 08:14:01 2000 | @ 5 hours | Wed Mar 15 13:14:01 2000 | Wed Mar 15 03:14:01 2000
|
|
|
|
Wed Mar 15 12:14:03 2000 | @ 1 min | Wed Mar 15 12:15:03 2000 | Wed Mar 15 12:13:03 2000
|
|
|
|
Wed Mar 15 12:14:03 2000 | @ 5 hours | Wed Mar 15 17:14:03 2000 | Wed Mar 15 07:14:03 2000
|
|
|
|
Wed Mar 15 13:14:02 2000 | @ 1 min | Wed Mar 15 13:15:02 2000 | Wed Mar 15 13:13:02 2000
|
|
|
|
Wed Mar 15 13:14:02 2000 | @ 5 hours | Wed Mar 15 18:14:02 2000 | Wed Mar 15 08:14:02 2000
|
|
|
|
Sun Dec 31 17:32:01 2000 | @ 1 min | Sun Dec 31 17:33:01 2000 | Sun Dec 31 17:31:01 2000
|
|
|
|
Sun Dec 31 17:32:01 2000 | @ 5 hours | Sun Dec 31 22:32:01 2000 | Sun Dec 31 12:32:01 2000
|
2006-07-06 03:46:38 +02:00
|
|
|
(104 rows)
|
2000-12-03 15:51:12 +01:00
|
|
|
|
2007-07-25 19:22:37 +02:00
|
|
|
SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
|
|
|
|
FROM TIME_TBL t, INTERVAL_TBL i
|
Support +/- infinity in the interval data type.
This adds support for infinity to the interval data type, using the
same input/output representation as the other date/time data types
that support infinity. This allows various arithmetic operations on
infinite dates, timestamps and intervals.
The new values are represented by setting all fields of the interval
to INT32/64_MIN for -infinity, and INT32/64_MAX for +infinity. This
ensures that they compare as less/greater than all other interval
values, without the need for any special-case comparison code.
Note that, since those 2 values were formerly accepted as legal finite
intervals, pg_upgrade and dump/restore from an old database will turn
them from finite to infinite intervals. That seems OK, since those
exact values should be extremely rare in practice, and they are
outside the documented range supported by the interval type, which
gives us a certain amount of leeway.
Bump catalog version.
Joseph Koshakow, Jian He, and Ashutosh Bapat, reviewed by me.
Discussion: https://postgr.es/m/CAAvxfHea4%2BsPybKK7agDYOMo9N-Z3J6ZXf3BOM79pFsFNcRjwA%40mail.gmail.com
2023-11-14 11:58:49 +01:00
|
|
|
WHERE isfinite(i.f1)
|
2007-07-25 19:22:37 +02:00
|
|
|
ORDER BY 1,2;
|
|
|
|
t | i | add | subtract
|
|
|
|
-------------+-------------------------------+-------------+-------------
|
|
|
|
00:00:00 | @ 14 secs ago | 23:59:46 | 00:00:14
|
|
|
|
00:00:00 | @ 1 min | 00:01:00 | 23:59:00
|
|
|
|
00:00:00 | @ 5 hours | 05:00:00 | 19:00:00
|
|
|
|
00:00:00 | @ 1 day 2 hours 3 mins 4 secs | 02:03:04 | 21:56:56
|
|
|
|
00:00:00 | @ 10 days | 00:00:00 | 00:00:00
|
|
|
|
00:00:00 | @ 3 mons | 00:00:00 | 00:00:00
|
|
|
|
00:00:00 | @ 5 mons | 00:00:00 | 00:00:00
|
|
|
|
00:00:00 | @ 5 mons 12 hours | 12:00:00 | 12:00:00
|
|
|
|
00:00:00 | @ 6 years | 00:00:00 | 00:00:00
|
|
|
|
00:00:00 | @ 34 years | 00:00:00 | 00:00:00
|
|
|
|
01:00:00 | @ 14 secs ago | 00:59:46 | 01:00:14
|
|
|
|
01:00:00 | @ 1 min | 01:01:00 | 00:59:00
|
|
|
|
01:00:00 | @ 5 hours | 06:00:00 | 20:00:00
|
|
|
|
01:00:00 | @ 1 day 2 hours 3 mins 4 secs | 03:03:04 | 22:56:56
|
|
|
|
01:00:00 | @ 10 days | 01:00:00 | 01:00:00
|
|
|
|
01:00:00 | @ 3 mons | 01:00:00 | 01:00:00
|
|
|
|
01:00:00 | @ 5 mons | 01:00:00 | 01:00:00
|
|
|
|
01:00:00 | @ 5 mons 12 hours | 13:00:00 | 13:00:00
|
|
|
|
01:00:00 | @ 6 years | 01:00:00 | 01:00:00
|
|
|
|
01:00:00 | @ 34 years | 01:00:00 | 01:00:00
|
|
|
|
02:03:00 | @ 14 secs ago | 02:02:46 | 02:03:14
|
|
|
|
02:03:00 | @ 1 min | 02:04:00 | 02:02:00
|
|
|
|
02:03:00 | @ 5 hours | 07:03:00 | 21:03:00
|
|
|
|
02:03:00 | @ 1 day 2 hours 3 mins 4 secs | 04:06:04 | 23:59:56
|
|
|
|
02:03:00 | @ 10 days | 02:03:00 | 02:03:00
|
|
|
|
02:03:00 | @ 3 mons | 02:03:00 | 02:03:00
|
|
|
|
02:03:00 | @ 5 mons | 02:03:00 | 02:03:00
|
|
|
|
02:03:00 | @ 5 mons 12 hours | 14:03:00 | 14:03:00
|
|
|
|
02:03:00 | @ 6 years | 02:03:00 | 02:03:00
|
|
|
|
02:03:00 | @ 34 years | 02:03:00 | 02:03:00
|
|
|
|
11:59:00 | @ 14 secs ago | 11:58:46 | 11:59:14
|
|
|
|
11:59:00 | @ 1 min | 12:00:00 | 11:58:00
|
|
|
|
11:59:00 | @ 5 hours | 16:59:00 | 06:59:00
|
|
|
|
11:59:00 | @ 1 day 2 hours 3 mins 4 secs | 14:02:04 | 09:55:56
|
|
|
|
11:59:00 | @ 10 days | 11:59:00 | 11:59:00
|
|
|
|
11:59:00 | @ 3 mons | 11:59:00 | 11:59:00
|
|
|
|
11:59:00 | @ 5 mons | 11:59:00 | 11:59:00
|
|
|
|
11:59:00 | @ 5 mons 12 hours | 23:59:00 | 23:59:00
|
|
|
|
11:59:00 | @ 6 years | 11:59:00 | 11:59:00
|
|
|
|
11:59:00 | @ 34 years | 11:59:00 | 11:59:00
|
|
|
|
12:00:00 | @ 14 secs ago | 11:59:46 | 12:00:14
|
|
|
|
12:00:00 | @ 1 min | 12:01:00 | 11:59:00
|
|
|
|
12:00:00 | @ 5 hours | 17:00:00 | 07:00:00
|
|
|
|
12:00:00 | @ 1 day 2 hours 3 mins 4 secs | 14:03:04 | 09:56:56
|
|
|
|
12:00:00 | @ 10 days | 12:00:00 | 12:00:00
|
|
|
|
12:00:00 | @ 3 mons | 12:00:00 | 12:00:00
|
|
|
|
12:00:00 | @ 5 mons | 12:00:00 | 12:00:00
|
|
|
|
12:00:00 | @ 5 mons 12 hours | 00:00:00 | 00:00:00
|
|
|
|
12:00:00 | @ 6 years | 12:00:00 | 12:00:00
|
|
|
|
12:00:00 | @ 34 years | 12:00:00 | 12:00:00
|
|
|
|
12:01:00 | @ 14 secs ago | 12:00:46 | 12:01:14
|
|
|
|
12:01:00 | @ 1 min | 12:02:00 | 12:00:00
|
|
|
|
12:01:00 | @ 5 hours | 17:01:00 | 07:01:00
|
|
|
|
12:01:00 | @ 1 day 2 hours 3 mins 4 secs | 14:04:04 | 09:57:56
|
|
|
|
12:01:00 | @ 10 days | 12:01:00 | 12:01:00
|
|
|
|
12:01:00 | @ 3 mons | 12:01:00 | 12:01:00
|
|
|
|
12:01:00 | @ 5 mons | 12:01:00 | 12:01:00
|
|
|
|
12:01:00 | @ 5 mons 12 hours | 00:01:00 | 00:01:00
|
|
|
|
12:01:00 | @ 6 years | 12:01:00 | 12:01:00
|
|
|
|
12:01:00 | @ 34 years | 12:01:00 | 12:01:00
|
|
|
|
15:36:39 | @ 14 secs ago | 15:36:25 | 15:36:53
|
|
|
|
15:36:39 | @ 14 secs ago | 15:36:25 | 15:36:53
|
|
|
|
15:36:39 | @ 1 min | 15:37:39 | 15:35:39
|
|
|
|
15:36:39 | @ 1 min | 15:37:39 | 15:35:39
|
|
|
|
15:36:39 | @ 5 hours | 20:36:39 | 10:36:39
|
|
|
|
15:36:39 | @ 5 hours | 20:36:39 | 10:36:39
|
|
|
|
15:36:39 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43 | 13:33:35
|
|
|
|
15:36:39 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43 | 13:33:35
|
|
|
|
15:36:39 | @ 10 days | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 10 days | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 3 mons | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 3 mons | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 5 mons | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 5 mons | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 5 mons 12 hours | 03:36:39 | 03:36:39
|
|
|
|
15:36:39 | @ 5 mons 12 hours | 03:36:39 | 03:36:39
|
|
|
|
15:36:39 | @ 6 years | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 6 years | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 34 years | 15:36:39 | 15:36:39
|
|
|
|
15:36:39 | @ 34 years | 15:36:39 | 15:36:39
|
|
|
|
23:59:00 | @ 14 secs ago | 23:58:46 | 23:59:14
|
|
|
|
23:59:00 | @ 1 min | 00:00:00 | 23:58:00
|
|
|
|
23:59:00 | @ 5 hours | 04:59:00 | 18:59:00
|
|
|
|
23:59:00 | @ 1 day 2 hours 3 mins 4 secs | 02:02:04 | 21:55:56
|
|
|
|
23:59:00 | @ 10 days | 23:59:00 | 23:59:00
|
|
|
|
23:59:00 | @ 3 mons | 23:59:00 | 23:59:00
|
|
|
|
23:59:00 | @ 5 mons | 23:59:00 | 23:59:00
|
|
|
|
23:59:00 | @ 5 mons 12 hours | 11:59:00 | 11:59:00
|
|
|
|
23:59:00 | @ 6 years | 23:59:00 | 23:59:00
|
|
|
|
23:59:00 | @ 34 years | 23:59:00 | 23:59:00
|
|
|
|
23:59:59.99 | @ 14 secs ago | 23:59:45.99 | 00:00:13.99
|
|
|
|
23:59:59.99 | @ 1 min | 00:00:59.99 | 23:58:59.99
|
|
|
|
23:59:59.99 | @ 5 hours | 04:59:59.99 | 18:59:59.99
|
|
|
|
23:59:59.99 | @ 1 day 2 hours 3 mins 4 secs | 02:03:03.99 | 21:56:55.99
|
|
|
|
23:59:59.99 | @ 10 days | 23:59:59.99 | 23:59:59.99
|
|
|
|
23:59:59.99 | @ 3 mons | 23:59:59.99 | 23:59:59.99
|
|
|
|
23:59:59.99 | @ 5 mons | 23:59:59.99 | 23:59:59.99
|
|
|
|
23:59:59.99 | @ 5 mons 12 hours | 11:59:59.99 | 11:59:59.99
|
|
|
|
23:59:59.99 | @ 6 years | 23:59:59.99 | 23:59:59.99
|
|
|
|
23:59:59.99 | @ 34 years | 23:59:59.99 | 23:59:59.99
|
2006-07-06 03:46:38 +02:00
|
|
|
(100 rows)
|
2000-12-03 15:51:12 +01:00
|
|
|
|
2007-07-25 19:22:37 +02:00
|
|
|
SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
|
|
|
|
FROM TIMETZ_TBL t, INTERVAL_TBL i
|
Support +/- infinity in the interval data type.
This adds support for infinity to the interval data type, using the
same input/output representation as the other date/time data types
that support infinity. This allows various arithmetic operations on
infinite dates, timestamps and intervals.
The new values are represented by setting all fields of the interval
to INT32/64_MIN for -infinity, and INT32/64_MAX for +infinity. This
ensures that they compare as less/greater than all other interval
values, without the need for any special-case comparison code.
Note that, since those 2 values were formerly accepted as legal finite
intervals, pg_upgrade and dump/restore from an old database will turn
them from finite to infinite intervals. That seems OK, since those
exact values should be extremely rare in practice, and they are
outside the documented range supported by the interval type, which
gives us a certain amount of leeway.
Bump catalog version.
Joseph Koshakow, Jian He, and Ashutosh Bapat, reviewed by me.
Discussion: https://postgr.es/m/CAAvxfHea4%2BsPybKK7agDYOMo9N-Z3J6ZXf3BOM79pFsFNcRjwA%40mail.gmail.com
2023-11-14 11:58:49 +01:00
|
|
|
WHERE isfinite(i.f1)
|
2007-07-25 19:22:37 +02:00
|
|
|
ORDER BY 1,2;
|
|
|
|
t | i | add | subtract
|
|
|
|
----------------+-------------------------------+----------------+----------------
|
|
|
|
00:01:00-07 | @ 14 secs ago | 00:00:46-07 | 00:01:14-07
|
|
|
|
00:01:00-07 | @ 1 min | 00:02:00-07 | 00:00:00-07
|
|
|
|
00:01:00-07 | @ 5 hours | 05:01:00-07 | 19:01:00-07
|
|
|
|
00:01:00-07 | @ 1 day 2 hours 3 mins 4 secs | 02:04:04-07 | 21:57:56-07
|
|
|
|
00:01:00-07 | @ 10 days | 00:01:00-07 | 00:01:00-07
|
|
|
|
00:01:00-07 | @ 3 mons | 00:01:00-07 | 00:01:00-07
|
|
|
|
00:01:00-07 | @ 5 mons | 00:01:00-07 | 00:01:00-07
|
|
|
|
00:01:00-07 | @ 5 mons 12 hours | 12:01:00-07 | 12:01:00-07
|
|
|
|
00:01:00-07 | @ 6 years | 00:01:00-07 | 00:01:00-07
|
|
|
|
00:01:00-07 | @ 34 years | 00:01:00-07 | 00:01:00-07
|
|
|
|
01:00:00-07 | @ 14 secs ago | 00:59:46-07 | 01:00:14-07
|
|
|
|
01:00:00-07 | @ 1 min | 01:01:00-07 | 00:59:00-07
|
|
|
|
01:00:00-07 | @ 5 hours | 06:00:00-07 | 20:00:00-07
|
|
|
|
01:00:00-07 | @ 1 day 2 hours 3 mins 4 secs | 03:03:04-07 | 22:56:56-07
|
|
|
|
01:00:00-07 | @ 10 days | 01:00:00-07 | 01:00:00-07
|
|
|
|
01:00:00-07 | @ 3 mons | 01:00:00-07 | 01:00:00-07
|
|
|
|
01:00:00-07 | @ 5 mons | 01:00:00-07 | 01:00:00-07
|
|
|
|
01:00:00-07 | @ 5 mons 12 hours | 13:00:00-07 | 13:00:00-07
|
|
|
|
01:00:00-07 | @ 6 years | 01:00:00-07 | 01:00:00-07
|
|
|
|
01:00:00-07 | @ 34 years | 01:00:00-07 | 01:00:00-07
|
|
|
|
02:03:00-07 | @ 14 secs ago | 02:02:46-07 | 02:03:14-07
|
|
|
|
02:03:00-07 | @ 1 min | 02:04:00-07 | 02:02:00-07
|
|
|
|
02:03:00-07 | @ 5 hours | 07:03:00-07 | 21:03:00-07
|
|
|
|
02:03:00-07 | @ 1 day 2 hours 3 mins 4 secs | 04:06:04-07 | 23:59:56-07
|
|
|
|
02:03:00-07 | @ 10 days | 02:03:00-07 | 02:03:00-07
|
|
|
|
02:03:00-07 | @ 3 mons | 02:03:00-07 | 02:03:00-07
|
|
|
|
02:03:00-07 | @ 5 mons | 02:03:00-07 | 02:03:00-07
|
|
|
|
02:03:00-07 | @ 5 mons 12 hours | 14:03:00-07 | 14:03:00-07
|
|
|
|
02:03:00-07 | @ 6 years | 02:03:00-07 | 02:03:00-07
|
|
|
|
02:03:00-07 | @ 34 years | 02:03:00-07 | 02:03:00-07
|
|
|
|
08:08:00-04 | @ 14 secs ago | 08:07:46-04 | 08:08:14-04
|
|
|
|
08:08:00-04 | @ 1 min | 08:09:00-04 | 08:07:00-04
|
|
|
|
08:08:00-04 | @ 5 hours | 13:08:00-04 | 03:08:00-04
|
|
|
|
08:08:00-04 | @ 1 day 2 hours 3 mins 4 secs | 10:11:04-04 | 06:04:56-04
|
|
|
|
08:08:00-04 | @ 10 days | 08:08:00-04 | 08:08:00-04
|
|
|
|
08:08:00-04 | @ 3 mons | 08:08:00-04 | 08:08:00-04
|
|
|
|
08:08:00-04 | @ 5 mons | 08:08:00-04 | 08:08:00-04
|
|
|
|
08:08:00-04 | @ 5 mons 12 hours | 20:08:00-04 | 20:08:00-04
|
|
|
|
08:08:00-04 | @ 6 years | 08:08:00-04 | 08:08:00-04
|
|
|
|
08:08:00-04 | @ 34 years | 08:08:00-04 | 08:08:00-04
|
|
|
|
07:07:00-08 | @ 14 secs ago | 07:06:46-08 | 07:07:14-08
|
|
|
|
07:07:00-08 | @ 1 min | 07:08:00-08 | 07:06:00-08
|
|
|
|
07:07:00-08 | @ 5 hours | 12:07:00-08 | 02:07:00-08
|
|
|
|
07:07:00-08 | @ 1 day 2 hours 3 mins 4 secs | 09:10:04-08 | 05:03:56-08
|
|
|
|
07:07:00-08 | @ 10 days | 07:07:00-08 | 07:07:00-08
|
|
|
|
07:07:00-08 | @ 3 mons | 07:07:00-08 | 07:07:00-08
|
|
|
|
07:07:00-08 | @ 5 mons | 07:07:00-08 | 07:07:00-08
|
|
|
|
07:07:00-08 | @ 5 mons 12 hours | 19:07:00-08 | 19:07:00-08
|
|
|
|
07:07:00-08 | @ 6 years | 07:07:00-08 | 07:07:00-08
|
|
|
|
07:07:00-08 | @ 34 years | 07:07:00-08 | 07:07:00-08
|
|
|
|
11:59:00-07 | @ 14 secs ago | 11:58:46-07 | 11:59:14-07
|
|
|
|
11:59:00-07 | @ 1 min | 12:00:00-07 | 11:58:00-07
|
|
|
|
11:59:00-07 | @ 5 hours | 16:59:00-07 | 06:59:00-07
|
|
|
|
11:59:00-07 | @ 1 day 2 hours 3 mins 4 secs | 14:02:04-07 | 09:55:56-07
|
|
|
|
11:59:00-07 | @ 10 days | 11:59:00-07 | 11:59:00-07
|
|
|
|
11:59:00-07 | @ 3 mons | 11:59:00-07 | 11:59:00-07
|
|
|
|
11:59:00-07 | @ 5 mons | 11:59:00-07 | 11:59:00-07
|
|
|
|
11:59:00-07 | @ 5 mons 12 hours | 23:59:00-07 | 23:59:00-07
|
|
|
|
11:59:00-07 | @ 6 years | 11:59:00-07 | 11:59:00-07
|
|
|
|
11:59:00-07 | @ 34 years | 11:59:00-07 | 11:59:00-07
|
|
|
|
12:00:00-07 | @ 14 secs ago | 11:59:46-07 | 12:00:14-07
|
|
|
|
12:00:00-07 | @ 1 min | 12:01:00-07 | 11:59:00-07
|
|
|
|
12:00:00-07 | @ 5 hours | 17:00:00-07 | 07:00:00-07
|
|
|
|
12:00:00-07 | @ 1 day 2 hours 3 mins 4 secs | 14:03:04-07 | 09:56:56-07
|
|
|
|
12:00:00-07 | @ 10 days | 12:00:00-07 | 12:00:00-07
|
|
|
|
12:00:00-07 | @ 3 mons | 12:00:00-07 | 12:00:00-07
|
|
|
|
12:00:00-07 | @ 5 mons | 12:00:00-07 | 12:00:00-07
|
|
|
|
12:00:00-07 | @ 5 mons 12 hours | 00:00:00-07 | 00:00:00-07
|
|
|
|
12:00:00-07 | @ 6 years | 12:00:00-07 | 12:00:00-07
|
|
|
|
12:00:00-07 | @ 34 years | 12:00:00-07 | 12:00:00-07
|
|
|
|
12:01:00-07 | @ 14 secs ago | 12:00:46-07 | 12:01:14-07
|
|
|
|
12:01:00-07 | @ 1 min | 12:02:00-07 | 12:00:00-07
|
|
|
|
12:01:00-07 | @ 5 hours | 17:01:00-07 | 07:01:00-07
|
|
|
|
12:01:00-07 | @ 1 day 2 hours 3 mins 4 secs | 14:04:04-07 | 09:57:56-07
|
|
|
|
12:01:00-07 | @ 10 days | 12:01:00-07 | 12:01:00-07
|
|
|
|
12:01:00-07 | @ 3 mons | 12:01:00-07 | 12:01:00-07
|
|
|
|
12:01:00-07 | @ 5 mons | 12:01:00-07 | 12:01:00-07
|
|
|
|
12:01:00-07 | @ 5 mons 12 hours | 00:01:00-07 | 00:01:00-07
|
|
|
|
12:01:00-07 | @ 6 years | 12:01:00-07 | 12:01:00-07
|
|
|
|
12:01:00-07 | @ 34 years | 12:01:00-07 | 12:01:00-07
|
|
|
|
15:36:39-04 | @ 14 secs ago | 15:36:25-04 | 15:36:53-04
|
|
|
|
15:36:39-04 | @ 1 min | 15:37:39-04 | 15:35:39-04
|
|
|
|
15:36:39-04 | @ 5 hours | 20:36:39-04 | 10:36:39-04
|
|
|
|
15:36:39-04 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43-04 | 13:33:35-04
|
|
|
|
15:36:39-04 | @ 10 days | 15:36:39-04 | 15:36:39-04
|
|
|
|
15:36:39-04 | @ 3 mons | 15:36:39-04 | 15:36:39-04
|
|
|
|
15:36:39-04 | @ 5 mons | 15:36:39-04 | 15:36:39-04
|
|
|
|
15:36:39-04 | @ 5 mons 12 hours | 03:36:39-04 | 03:36:39-04
|
|
|
|
15:36:39-04 | @ 6 years | 15:36:39-04 | 15:36:39-04
|
|
|
|
15:36:39-04 | @ 34 years | 15:36:39-04 | 15:36:39-04
|
|
|
|
15:36:39-05 | @ 14 secs ago | 15:36:25-05 | 15:36:53-05
|
|
|
|
15:36:39-05 | @ 1 min | 15:37:39-05 | 15:35:39-05
|
|
|
|
15:36:39-05 | @ 5 hours | 20:36:39-05 | 10:36:39-05
|
|
|
|
15:36:39-05 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43-05 | 13:33:35-05
|
|
|
|
15:36:39-05 | @ 10 days | 15:36:39-05 | 15:36:39-05
|
|
|
|
15:36:39-05 | @ 3 mons | 15:36:39-05 | 15:36:39-05
|
|
|
|
15:36:39-05 | @ 5 mons | 15:36:39-05 | 15:36:39-05
|
|
|
|
15:36:39-05 | @ 5 mons 12 hours | 03:36:39-05 | 03:36:39-05
|
|
|
|
15:36:39-05 | @ 6 years | 15:36:39-05 | 15:36:39-05
|
|
|
|
15:36:39-05 | @ 34 years | 15:36:39-05 | 15:36:39-05
|
|
|
|
23:59:00-07 | @ 14 secs ago | 23:58:46-07 | 23:59:14-07
|
|
|
|
23:59:00-07 | @ 1 min | 00:00:00-07 | 23:58:00-07
|
|
|
|
23:59:00-07 | @ 5 hours | 04:59:00-07 | 18:59:00-07
|
|
|
|
23:59:00-07 | @ 1 day 2 hours 3 mins 4 secs | 02:02:04-07 | 21:55:56-07
|
|
|
|
23:59:00-07 | @ 10 days | 23:59:00-07 | 23:59:00-07
|
|
|
|
23:59:00-07 | @ 3 mons | 23:59:00-07 | 23:59:00-07
|
|
|
|
23:59:00-07 | @ 5 mons | 23:59:00-07 | 23:59:00-07
|
|
|
|
23:59:00-07 | @ 5 mons 12 hours | 11:59:00-07 | 11:59:00-07
|
|
|
|
23:59:00-07 | @ 6 years | 23:59:00-07 | 23:59:00-07
|
|
|
|
23:59:00-07 | @ 34 years | 23:59:00-07 | 23:59:00-07
|
|
|
|
23:59:59.99-07 | @ 14 secs ago | 23:59:45.99-07 | 00:00:13.99-07
|
|
|
|
23:59:59.99-07 | @ 1 min | 00:00:59.99-07 | 23:58:59.99-07
|
|
|
|
23:59:59.99-07 | @ 5 hours | 04:59:59.99-07 | 18:59:59.99-07
|
|
|
|
23:59:59.99-07 | @ 1 day 2 hours 3 mins 4 secs | 02:03:03.99-07 | 21:56:55.99-07
|
|
|
|
23:59:59.99-07 | @ 10 days | 23:59:59.99-07 | 23:59:59.99-07
|
|
|
|
23:59:59.99-07 | @ 3 mons | 23:59:59.99-07 | 23:59:59.99-07
|
|
|
|
23:59:59.99-07 | @ 5 mons | 23:59:59.99-07 | 23:59:59.99-07
|
|
|
|
23:59:59.99-07 | @ 5 mons 12 hours | 11:59:59.99-07 | 11:59:59.99-07
|
|
|
|
23:59:59.99-07 | @ 6 years | 23:59:59.99-07 | 23:59:59.99-07
|
|
|
|
23:59:59.99-07 | @ 34 years | 23:59:59.99-07 | 23:59:59.99-07
|
2006-07-06 03:46:38 +02:00
|
|
|
(120 rows)
|
2000-12-03 15:51:12 +01:00
|
|
|
|
|
|
|
-- SQL9x OVERLAPS operator
|
2001-09-28 10:00:11 +02:00
|
|
|
-- test with time zone
|
|
|
|
SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
|
|
|
|
OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "True";
|
2000-12-03 15:51:12 +01:00
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp with time zone '2000-11-26', timestamp with time zone '2000-11-27')
|
|
|
|
OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
|
2000-12-03 15:51:12 +01:00
|
|
|
False
|
|
|
|
-------
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
|
|
|
|
OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
|
2000-12-03 15:51:12 +01:00
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
|
|
|
|
OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
|
2000-12-03 15:51:12 +01:00
|
|
|
False
|
|
|
|
-------
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
|
|
|
|
OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
|
2000-12-03 15:51:12 +01:00
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
|
|
|
|
OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
|
2000-12-03 15:51:12 +01:00
|
|
|
False
|
|
|
|
-------
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
-- test without time zone
|
|
|
|
SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
|
|
|
|
OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '2000-11-26', timestamp without time zone '2000-11-27')
|
|
|
|
OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
|
|
|
|
False
|
|
|
|
-------
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
|
|
|
|
OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
|
|
|
|
OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
|
|
|
|
False
|
|
|
|
-------
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
|
|
|
|
OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
|
|
|
|
OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
|
|
|
|
False
|
|
|
|
-------
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- test time and interval
|
2000-12-03 15:51:12 +01:00
|
|
|
SELECT (time '00:00', time '01:00')
|
|
|
|
OVERLAPS (time '00:30', time '01:30') AS "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (time '00:00', interval '1 hour')
|
|
|
|
OVERLAPS (time '00:30', interval '1 hour') AS "True";
|
|
|
|
True
|
|
|
|
------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT (time '00:00', interval '1 hour')
|
|
|
|
OVERLAPS (time '01:30', interval '1 hour') AS "False";
|
|
|
|
False
|
|
|
|
-------
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
2001-09-28 10:00:11 +02:00
|
|
|
-- SQL99 seems to want this to be false (and we conform to the spec).
|
|
|
|
-- istm that this *should* return true, on the theory that time
|
|
|
|
-- intervals can wrap around the day boundary - thomas 2001-09-25
|
2000-12-03 15:51:12 +01:00
|
|
|
SELECT (time '00:00', interval '1 hour')
|
2001-09-28 10:00:11 +02:00
|
|
|
OVERLAPS (time '01:30', interval '1 day') AS "False";
|
|
|
|
False
|
|
|
|
-------
|
2000-12-03 15:51:12 +01:00
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
2002-04-21 21:52:18 +02:00
|
|
|
CREATE TABLE TEMP_TIMESTAMP (f1 timestamp with time zone);
|
2000-01-05 07:06:23 +01:00
|
|
|
-- get some candidate input values
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
INSERT INTO TEMP_TIMESTAMP (f1)
|
|
|
|
SELECT d1 FROM TIMESTAMP_TBL
|
1997-05-11 17:42:09 +02:00
|
|
|
WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
|
|
|
|
OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT f1 AS "timestamp"
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
FROM TEMP_TIMESTAMP
|
2001-10-03 07:29:27 +02:00
|
|
|
ORDER BY "timestamp";
|
2020-12-15 21:54:06 +01:00
|
|
|
timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jan 01 00:00:00 1970 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT
|
2001-09-28 10:00:11 +02:00
|
|
|
(16 rows)
|
1997-05-11 17:42:09 +02:00
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 + t.f1 AS plus
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
|
2001-10-18 19:30:21 +02:00
|
|
|
ORDER BY plus, "timestamp", "interval";
|
2020-12-15 21:54:06 +01:00
|
|
|
timestamp | interval | plus
|
|
|
|
------------------------------+-------------------------------+------------------------------
|
Support +/- infinity in the interval data type.
This adds support for infinity to the interval data type, using the
same input/output representation as the other date/time data types
that support infinity. This allows various arithmetic operations on
infinite dates, timestamps and intervals.
The new values are represented by setting all fields of the interval
to INT32/64_MIN for -infinity, and INT32/64_MAX for +infinity. This
ensures that they compare as less/greater than all other interval
values, without the need for any special-case comparison code.
Note that, since those 2 values were formerly accepted as legal finite
intervals, pg_upgrade and dump/restore from an old database will turn
them from finite to infinite intervals. That seems OK, since those
exact values should be extremely rare in practice, and they are
outside the documented range supported by the interval type, which
gives us a certain amount of leeway.
Bump catalog version.
Joseph Koshakow, Jian He, and Ashutosh Bapat, reviewed by me.
Discussion: https://postgr.es/m/CAAvxfHea4%2BsPybKK7agDYOMo9N-Z3J6ZXf3BOM79pFsFNcRjwA%40mail.gmail.com
2023-11-14 11:58:49 +01:00
|
|
|
Thu Jan 01 00:00:00 1970 PST | -infinity | -infinity
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | -infinity | -infinity
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | -infinity | -infinity
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | -infinity | -infinity
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | -infinity | -infinity
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | -infinity | -infinity
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | -infinity | -infinity
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | -infinity | -infinity
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | -infinity | -infinity
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | -infinity | -infinity
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | -infinity | -infinity
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | -infinity | -infinity
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | -infinity | -infinity
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | -infinity | -infinity
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | -infinity | -infinity
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | -infinity | -infinity
|
2020-12-15 21:54:06 +01:00
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 14 secs ago | Wed Dec 31 23:59:46 1969 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 1 min | Thu Jan 01 00:01:00 1970 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 5 hours | Thu Jan 01 05:00:00 1970 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 1 day 2 hours 3 mins 4 secs | Fri Jan 02 02:03:04 1970 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 10 days | Sun Jan 11 00:00:00 1970 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 3 mons | Wed Apr 01 00:00:00 1970 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 5 mons | Mon Jun 01 00:00:00 1970 PDT
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 5 mons 12 hours | Mon Jun 01 12:00:00 1970 PDT
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 6 years | Thu Jan 01 00:00:00 1976 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 14 secs ago | Wed Feb 28 17:31:47 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 1 min | Wed Feb 28 17:33:01 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 5 hours | Wed Feb 28 22:32:01 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 14 secs ago | Thu Feb 29 17:31:47 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 1 min | Thu Feb 29 17:33:01 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Feb 29 19:35:05 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 5 hours | Thu Feb 29 22:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 14 secs ago | Fri Mar 01 17:31:47 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 1 min | Fri Mar 01 17:33:01 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Fri Mar 01 19:35:05 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 5 hours | Fri Mar 01 22:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Sat Mar 02 19:35:05 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 10 days | Sat Mar 09 17:32:01 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 10 days | Sun Mar 10 17:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 10 days | Mon Mar 11 17:32:01 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 3 mons | Tue May 28 17:32:01 1996 PDT
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 3 mons | Wed May 29 17:32:01 1996 PDT
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 3 mons | Sat Jun 01 17:32:01 1996 PDT
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 5 mons | Sun Jul 28 17:32:01 1996 PDT
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 5 mons 12 hours | Mon Jul 29 05:32:01 1996 PDT
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 5 mons | Mon Jul 29 17:32:01 1996 PDT
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 5 mons 12 hours | Tue Jul 30 05:32:01 1996 PDT
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 5 mons | Thu Aug 01 17:32:01 1996 PDT
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 5 mons 12 hours | Fri Aug 02 05:32:01 1996 PDT
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 14 secs ago | Mon Dec 30 17:31:47 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 1 min | Mon Dec 30 17:33:01 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 5 hours | Mon Dec 30 22:32:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 14 secs ago | Tue Dec 31 17:31:47 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 1 min | Tue Dec 31 17:33:01 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Dec 31 19:35:05 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 5 hours | Tue Dec 31 22:32:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Wed Jan 01 19:35:05 1997 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 10 days | Thu Jan 09 17:32:01 1997 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 10 days | Fri Jan 10 17:32:01 1997 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 3 mons | Sun Mar 30 17:32:01 1997 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 3 mons | Mon Mar 31 17:32:01 1997 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 5 mons | Fri May 30 17:32:01 1997 PDT
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 5 mons 12 hours | Sat May 31 05:32:01 1997 PDT
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 5 mons | Sat May 31 17:32:01 1997 PDT
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 5 mons 12 hours | Sun Jun 01 05:32:01 1997 PDT
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 14 secs ago | Fri Dec 31 17:31:47 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 1 min | Fri Dec 31 17:33:01 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 5 hours | Fri Dec 31 22:32:01 1999 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 14 secs ago | Sat Jan 01 17:31:47 2000 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 1 min | Sat Jan 01 17:33:01 2000 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 1 day 2 hours 3 mins 4 secs | Sat Jan 01 19:35:05 2000 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 5 hours | Sat Jan 01 22:32:01 2000 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Sun Jan 02 19:35:05 2000 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 10 days | Mon Jan 10 17:32:01 2000 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 10 days | Tue Jan 11 17:32:01 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 14 secs ago | Wed Mar 15 02:13:51 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 1 min | Wed Mar 15 02:15:05 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 14 secs ago | Wed Mar 15 03:13:50 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 1 min | Wed Mar 15 03:15:04 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 5 hours | Wed Mar 15 07:14:05 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 14 secs ago | Wed Mar 15 08:13:47 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 5 hours | Wed Mar 15 08:14:04 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 1 min | Wed Mar 15 08:15:01 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 14 secs ago | Wed Mar 15 12:13:49 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 1 min | Wed Mar 15 12:15:03 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 14 secs ago | Wed Mar 15 13:13:48 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 5 hours | Wed Mar 15 13:14:01 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 1 min | Wed Mar 15 13:15:02 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 5 hours | Wed Mar 15 17:14:03 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 5 hours | Wed Mar 15 18:14:02 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 04:17:09 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 05:17:08 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 10:17:05 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 14:17:07 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 15:17:06 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 10 days | Sat Mar 25 02:14:05 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 10 days | Sat Mar 25 03:14:04 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 10 days | Sat Mar 25 08:14:01 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 10 days | Sat Mar 25 12:14:03 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 10 days | Sat Mar 25 13:14:02 2000 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 3 mons | Fri Mar 31 17:32:01 2000 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 3 mons | Sat Apr 01 17:32:01 2000 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 5 mons | Wed May 31 17:32:01 2000 PDT
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 5 mons 12 hours | Thu Jun 01 05:32:01 2000 PDT
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 5 mons | Thu Jun 01 17:32:01 2000 PDT
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 5 mons 12 hours | Fri Jun 02 05:32:01 2000 PDT
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 3 mons | Thu Jun 15 02:14:05 2000 PDT
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 3 mons | Thu Jun 15 03:14:04 2000 PDT
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 3 mons | Thu Jun 15 08:14:01 2000 PDT
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 3 mons | Thu Jun 15 12:14:03 2000 PDT
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 3 mons | Thu Jun 15 13:14:02 2000 PDT
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 5 mons | Tue Aug 15 02:14:05 2000 PDT
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 5 mons | Tue Aug 15 03:14:04 2000 PDT
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 5 mons | Tue Aug 15 08:14:01 2000 PDT
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 5 mons | Tue Aug 15 12:14:03 2000 PDT
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 5 mons | Tue Aug 15 13:14:02 2000 PDT
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 5 mons 12 hours | Tue Aug 15 14:14:05 2000 PDT
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 5 mons 12 hours | Tue Aug 15 15:14:04 2000 PDT
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 5 mons 12 hours | Tue Aug 15 20:14:01 2000 PDT
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 5 mons 12 hours | Wed Aug 16 00:14:03 2000 PDT
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 5 mons 12 hours | Wed Aug 16 01:14:02 2000 PDT
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 14 secs ago | Sun Dec 31 17:31:47 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 1 min | Sun Dec 31 17:33:01 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 5 hours | Sun Dec 31 22:32:01 2000 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 14 secs ago | Mon Jan 01 17:31:47 2001 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 1 min | Mon Jan 01 17:33:01 2001 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Mon Jan 01 19:35:05 2001 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 5 hours | Mon Jan 01 22:32:01 2001 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Jan 02 19:35:05 2001 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 10 days | Wed Jan 10 17:32:01 2001 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 10 days | Thu Jan 11 17:32:01 2001 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 3 mons | Sat Mar 31 17:32:01 2001 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 3 mons | Sun Apr 01 17:32:01 2001 PDT
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 5 mons | Thu May 31 17:32:01 2001 PDT
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 5 mons 12 hours | Fri Jun 01 05:32:01 2001 PDT
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 5 mons | Fri Jun 01 17:32:01 2001 PDT
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 5 mons 12 hours | Sat Jun 02 05:32:01 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 14 secs ago | Sat Sep 22 18:19:06 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 1 min | Sat Sep 22 18:20:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 5 hours | Sat Sep 22 23:19:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 1 day 2 hours 3 mins 4 secs | Sun Sep 23 20:22:24 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 10 days | Tue Oct 02 18:19:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 3 mons | Sat Dec 22 18:19:20 2001 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 5 mons | Fri Feb 22 18:19:20 2002 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 5 mons 12 hours | Sat Feb 23 06:19:20 2002 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 6 years | Thu Feb 28 17:32:01 2002 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 6 years | Thu Feb 28 17:32:01 2002 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 6 years | Fri Mar 01 17:32:01 2002 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 6 years | Mon Dec 30 17:32:01 2002 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 6 years | Tue Dec 31 17:32:01 2002 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 34 years | Thu Jan 01 00:00:00 2004 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 6 years | Sat Dec 31 17:32:01 2005 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 6 years | Sun Jan 01 17:32:01 2006 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 6 years | Wed Mar 15 02:14:05 2006 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 6 years | Wed Mar 15 03:14:04 2006 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 6 years | Wed Mar 15 08:14:01 2006 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 6 years | Wed Mar 15 12:14:03 2006 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 6 years | Wed Mar 15 13:14:02 2006 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 6 years | Sun Dec 31 17:32:01 2006 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 6 years | Mon Jan 01 17:32:01 2007 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 6 years | Sat Sep 22 18:19:20 2007 PDT
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 34 years | Thu Feb 28 17:32:01 2030 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 34 years | Thu Feb 28 17:32:01 2030 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 34 years | Fri Mar 01 17:32:01 2030 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 34 years | Mon Dec 30 17:32:01 2030 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 34 years | Tue Dec 31 17:32:01 2030 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 34 years | Sat Dec 31 17:32:01 2033 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 34 years | Sun Jan 01 17:32:01 2034 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 34 years | Wed Mar 15 02:14:05 2034 PDT
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 34 years | Wed Mar 15 03:14:04 2034 PDT
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 34 years | Wed Mar 15 08:14:01 2034 PDT
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 34 years | Wed Mar 15 12:14:03 2034 PDT
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 34 years | Wed Mar 15 13:14:02 2034 PDT
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 34 years | Sun Dec 31 17:32:01 2034 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 34 years | Mon Jan 01 17:32:01 2035 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 34 years | Sat Sep 22 18:19:20 2035 PDT
|
Support +/- infinity in the interval data type.
This adds support for infinity to the interval data type, using the
same input/output representation as the other date/time data types
that support infinity. This allows various arithmetic operations on
infinite dates, timestamps and intervals.
The new values are represented by setting all fields of the interval
to INT32/64_MIN for -infinity, and INT32/64_MAX for +infinity. This
ensures that they compare as less/greater than all other interval
values, without the need for any special-case comparison code.
Note that, since those 2 values were formerly accepted as legal finite
intervals, pg_upgrade and dump/restore from an old database will turn
them from finite to infinite intervals. That seems OK, since those
exact values should be extremely rare in practice, and they are
outside the documented range supported by the interval type, which
gives us a certain amount of leeway.
Bump catalog version.
Joseph Koshakow, Jian He, and Ashutosh Bapat, reviewed by me.
Discussion: https://postgr.es/m/CAAvxfHea4%2BsPybKK7agDYOMo9N-Z3J6ZXf3BOM79pFsFNcRjwA%40mail.gmail.com
2023-11-14 11:58:49 +01:00
|
|
|
Thu Jan 01 00:00:00 1970 PST | infinity | infinity
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | infinity | infinity
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | infinity | infinity
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | infinity | infinity
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | infinity | infinity
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | infinity | infinity
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | infinity | infinity
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | infinity | infinity
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | infinity | infinity
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | infinity | infinity
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | infinity | infinity
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | infinity | infinity
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | infinity | infinity
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | infinity | infinity
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | infinity | infinity
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | infinity | infinity
|
|
|
|
(192 rows)
|
1997-05-11 17:42:09 +02:00
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 - t.f1 AS minus
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
|
2001-10-18 19:30:21 +02:00
|
|
|
ORDER BY minus, "timestamp", "interval";
|
2020-12-15 21:54:06 +01:00
|
|
|
timestamp | interval | minus
|
|
|
|
------------------------------+-------------------------------+------------------------------
|
Support +/- infinity in the interval data type.
This adds support for infinity to the interval data type, using the
same input/output representation as the other date/time data types
that support infinity. This allows various arithmetic operations on
infinite dates, timestamps and intervals.
The new values are represented by setting all fields of the interval
to INT32/64_MIN for -infinity, and INT32/64_MAX for +infinity. This
ensures that they compare as less/greater than all other interval
values, without the need for any special-case comparison code.
Note that, since those 2 values were formerly accepted as legal finite
intervals, pg_upgrade and dump/restore from an old database will turn
them from finite to infinite intervals. That seems OK, since those
exact values should be extremely rare in practice, and they are
outside the documented range supported by the interval type, which
gives us a certain amount of leeway.
Bump catalog version.
Joseph Koshakow, Jian He, and Ashutosh Bapat, reviewed by me.
Discussion: https://postgr.es/m/CAAvxfHea4%2BsPybKK7agDYOMo9N-Z3J6ZXf3BOM79pFsFNcRjwA%40mail.gmail.com
2023-11-14 11:58:49 +01:00
|
|
|
Thu Jan 01 00:00:00 1970 PST | infinity | -infinity
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | infinity | -infinity
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | infinity | -infinity
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | infinity | -infinity
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | infinity | -infinity
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | infinity | -infinity
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | infinity | -infinity
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | infinity | -infinity
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | infinity | -infinity
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | infinity | -infinity
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | infinity | -infinity
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | infinity | -infinity
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | infinity | -infinity
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | infinity | -infinity
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | infinity | -infinity
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | infinity | -infinity
|
2020-12-15 21:54:06 +01:00
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 34 years | Wed Jan 01 00:00:00 1936 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 34 years | Wed Feb 28 17:32:01 1962 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 34 years | Wed Feb 28 17:32:01 1962 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 34 years | Thu Mar 01 17:32:01 1962 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 34 years | Sun Dec 30 17:32:01 1962 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 34 years | Mon Dec 31 17:32:01 1962 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 6 years | Wed Jan 01 00:00:00 1964 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 34 years | Fri Dec 31 17:32:01 1965 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 34 years | Sat Jan 01 17:32:01 1966 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 34 years | Tue Mar 15 02:14:05 1966 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 34 years | Tue Mar 15 03:14:04 1966 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 34 years | Tue Mar 15 08:14:01 1966 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 34 years | Tue Mar 15 12:14:03 1966 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 34 years | Tue Mar 15 13:14:02 1966 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 34 years | Sat Dec 31 17:32:01 1966 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 34 years | Sun Jan 01 17:32:01 1967 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 34 years | Fri Sep 22 18:19:20 1967 PDT
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 5 mons 12 hours | Thu Jul 31 12:00:00 1969 PDT
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 5 mons | Fri Aug 01 00:00:00 1969 PDT
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 3 mons | Wed Oct 01 00:00:00 1969 PDT
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 10 days | Mon Dec 22 00:00:00 1969 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Dec 30 21:56:56 1969 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 5 hours | Wed Dec 31 19:00:00 1969 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 1 min | Wed Dec 31 23:59:00 1969 PST
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | @ 14 secs ago | Thu Jan 01 00:00:14 1970 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 6 years | Wed Feb 28 17:32:01 1990 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 6 years | Wed Feb 28 17:32:01 1990 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 6 years | Thu Mar 01 17:32:01 1990 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 6 years | Sun Dec 30 17:32:01 1990 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 6 years | Mon Dec 31 17:32:01 1990 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 6 years | Fri Dec 31 17:32:01 1993 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 6 years | Sat Jan 01 17:32:01 1994 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 6 years | Tue Mar 15 02:14:05 1994 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 6 years | Tue Mar 15 03:14:04 1994 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 6 years | Tue Mar 15 08:14:01 1994 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 6 years | Tue Mar 15 12:14:03 1994 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 6 years | Tue Mar 15 13:14:02 1994 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 6 years | Sat Dec 31 17:32:01 1994 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 6 years | Sun Jan 01 17:32:01 1995 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 6 years | Fri Sep 22 18:19:20 1995 PDT
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 5 mons 12 hours | Thu Sep 28 05:32:01 1995 PDT
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 5 mons | Thu Sep 28 17:32:01 1995 PDT
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 5 mons 12 hours | Fri Sep 29 05:32:01 1995 PDT
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 5 mons | Fri Sep 29 17:32:01 1995 PDT
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 5 mons 12 hours | Sun Oct 01 05:32:01 1995 PDT
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 5 mons | Sun Oct 01 17:32:01 1995 PDT
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 3 mons | Tue Nov 28 17:32:01 1995 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 3 mons | Wed Nov 29 17:32:01 1995 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 3 mons | Fri Dec 01 17:32:01 1995 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 10 days | Sun Feb 18 17:32:01 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 10 days | Mon Feb 19 17:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 10 days | Tue Feb 20 17:32:01 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Feb 27 15:28:57 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 5 hours | Wed Feb 28 12:32:01 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Wed Feb 28 15:28:57 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 1 min | Wed Feb 28 17:31:01 1996 PST
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | @ 14 secs ago | Wed Feb 28 17:32:15 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 5 hours | Thu Feb 29 12:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Feb 29 15:28:57 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 1 min | Thu Feb 29 17:31:01 1996 PST
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | @ 14 secs ago | Thu Feb 29 17:32:15 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 5 hours | Fri Mar 01 12:32:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 1 min | Fri Mar 01 17:31:01 1996 PST
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | @ 14 secs ago | Fri Mar 01 17:32:15 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 5 mons 12 hours | Tue Jul 30 05:32:01 1996 PDT
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 5 mons | Tue Jul 30 17:32:01 1996 PDT
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 5 mons 12 hours | Wed Jul 31 05:32:01 1996 PDT
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 5 mons | Wed Jul 31 17:32:01 1996 PDT
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 3 mons | Mon Sep 30 17:32:01 1996 PDT
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 3 mons | Mon Sep 30 17:32:01 1996 PDT
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 10 days | Fri Dec 20 17:32:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 10 days | Sat Dec 21 17:32:01 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Sun Dec 29 15:28:57 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 5 hours | Mon Dec 30 12:32:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Mon Dec 30 15:28:57 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 1 min | Mon Dec 30 17:31:01 1996 PST
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | @ 14 secs ago | Mon Dec 30 17:32:15 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 5 hours | Tue Dec 31 12:32:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 1 min | Tue Dec 31 17:31:01 1996 PST
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | @ 14 secs ago | Tue Dec 31 17:32:15 1996 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 5 mons 12 hours | Sat Jul 31 05:32:01 1999 PDT
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 5 mons | Sat Jul 31 17:32:01 1999 PDT
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 5 mons 12 hours | Sun Aug 01 05:32:01 1999 PDT
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 5 mons | Sun Aug 01 17:32:01 1999 PDT
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 3 mons | Thu Sep 30 17:32:01 1999 PDT
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 3 mons | Fri Oct 01 17:32:01 1999 PDT
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 5 mons 12 hours | Thu Oct 14 14:14:05 1999 PDT
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 5 mons 12 hours | Thu Oct 14 15:14:04 1999 PDT
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 5 mons 12 hours | Thu Oct 14 20:14:01 1999 PDT
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 5 mons 12 hours | Fri Oct 15 00:14:03 1999 PDT
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 5 mons 12 hours | Fri Oct 15 01:14:02 1999 PDT
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 5 mons | Fri Oct 15 02:14:05 1999 PDT
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 5 mons | Fri Oct 15 03:14:04 1999 PDT
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 5 mons | Fri Oct 15 08:14:01 1999 PDT
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 5 mons | Fri Oct 15 12:14:03 1999 PDT
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 5 mons | Fri Oct 15 13:14:02 1999 PDT
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 3 mons | Wed Dec 15 02:14:05 1999 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 3 mons | Wed Dec 15 03:14:04 1999 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 3 mons | Wed Dec 15 08:14:01 1999 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 3 mons | Wed Dec 15 12:14:03 1999 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 3 mons | Wed Dec 15 13:14:02 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 10 days | Tue Dec 21 17:32:01 1999 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 10 days | Wed Dec 22 17:32:01 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Dec 30 15:28:57 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 5 hours | Fri Dec 31 12:32:01 1999 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Fri Dec 31 15:28:57 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 1 min | Fri Dec 31 17:31:01 1999 PST
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | @ 14 secs ago | Fri Dec 31 17:32:15 1999 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 5 hours | Sat Jan 01 12:32:01 2000 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 1 min | Sat Jan 01 17:31:01 2000 PST
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | @ 14 secs ago | Sat Jan 01 17:32:15 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 10 days | Sun Mar 05 02:14:05 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 10 days | Sun Mar 05 03:14:04 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 10 days | Sun Mar 05 08:14:01 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 10 days | Sun Mar 05 12:14:03 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 10 days | Sun Mar 05 13:14:02 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 00:11:01 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 01:11:00 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 06:10:57 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 10:10:59 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 11:10:58 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 5 hours | Tue Mar 14 21:14:05 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 5 hours | Tue Mar 14 22:14:04 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 1 min | Wed Mar 15 02:13:05 2000 PST
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | @ 14 secs ago | Wed Mar 15 02:14:19 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 1 min | Wed Mar 15 03:13:04 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 5 hours | Wed Mar 15 03:14:01 2000 PST
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | @ 14 secs ago | Wed Mar 15 03:14:18 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 5 hours | Wed Mar 15 07:14:03 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 1 min | Wed Mar 15 08:13:01 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 5 hours | Wed Mar 15 08:14:02 2000 PST
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | @ 14 secs ago | Wed Mar 15 08:14:15 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 1 min | Wed Mar 15 12:13:03 2000 PST
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | @ 14 secs ago | Wed Mar 15 12:14:17 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 1 min | Wed Mar 15 13:13:02 2000 PST
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | @ 14 secs ago | Wed Mar 15 13:14:16 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 5 mons 12 hours | Mon Jul 31 05:32:01 2000 PDT
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 5 mons | Mon Jul 31 17:32:01 2000 PDT
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 5 mons 12 hours | Tue Aug 01 05:32:01 2000 PDT
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 5 mons | Tue Aug 01 17:32:01 2000 PDT
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 3 mons | Sat Sep 30 17:32:01 2000 PDT
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 3 mons | Sun Oct 01 17:32:01 2000 PDT
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 10 days | Thu Dec 21 17:32:01 2000 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 10 days | Fri Dec 22 17:32:01 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Sat Dec 30 15:28:57 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 5 hours | Sun Dec 31 12:32:01 2000 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 1 day 2 hours 3 mins 4 secs | Sun Dec 31 15:28:57 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 1 min | Sun Dec 31 17:31:01 2000 PST
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | @ 14 secs ago | Sun Dec 31 17:32:15 2000 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 5 hours | Mon Jan 01 12:32:01 2001 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 1 min | Mon Jan 01 17:31:01 2001 PST
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | @ 14 secs ago | Mon Jan 01 17:32:15 2001 PST
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 5 mons 12 hours | Sun Apr 22 06:19:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 5 mons | Sun Apr 22 18:19:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 3 mons | Fri Jun 22 18:19:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 10 days | Wed Sep 12 18:19:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 1 day 2 hours 3 mins 4 secs | Fri Sep 21 16:16:16 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 5 hours | Sat Sep 22 13:19:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 1 min | Sat Sep 22 18:18:20 2001 PDT
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | @ 14 secs ago | Sat Sep 22 18:19:34 2001 PDT
|
Support +/- infinity in the interval data type.
This adds support for infinity to the interval data type, using the
same input/output representation as the other date/time data types
that support infinity. This allows various arithmetic operations on
infinite dates, timestamps and intervals.
The new values are represented by setting all fields of the interval
to INT32/64_MIN for -infinity, and INT32/64_MAX for +infinity. This
ensures that they compare as less/greater than all other interval
values, without the need for any special-case comparison code.
Note that, since those 2 values were formerly accepted as legal finite
intervals, pg_upgrade and dump/restore from an old database will turn
them from finite to infinite intervals. That seems OK, since those
exact values should be extremely rare in practice, and they are
outside the documented range supported by the interval type, which
gives us a certain amount of leeway.
Bump catalog version.
Joseph Koshakow, Jian He, and Ashutosh Bapat, reviewed by me.
Discussion: https://postgr.es/m/CAAvxfHea4%2BsPybKK7agDYOMo9N-Z3J6ZXf3BOM79pFsFNcRjwA%40mail.gmail.com
2023-11-14 11:58:49 +01:00
|
|
|
Thu Jan 01 00:00:00 1970 PST | -infinity | infinity
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | -infinity | infinity
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | -infinity | infinity
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | -infinity | infinity
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | -infinity | infinity
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | -infinity | infinity
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | -infinity | infinity
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | -infinity | infinity
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | -infinity | infinity
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | -infinity | infinity
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | -infinity | infinity
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | -infinity | infinity
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | -infinity | infinity
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | -infinity | infinity
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | -infinity | infinity
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | -infinity | infinity
|
|
|
|
(192 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d.f1 AS "timestamp",
|
2002-04-21 21:52:18 +02:00
|
|
|
timestamp with time zone '1980-01-06 00:00 GMT' AS gpstime_zero,
|
|
|
|
d.f1 - timestamp with time zone '1980-01-06 00:00 GMT' AS difference
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
FROM TEMP_TIMESTAMP d
|
1997-05-11 17:42:09 +02:00
|
|
|
ORDER BY difference;
|
2020-12-15 21:54:06 +01:00
|
|
|
timestamp | gpstime_zero | difference
|
|
|
|
------------------------------+------------------------------+-------------------------------------
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Sat Jan 05 16:00:00 1980 PST | @ 3656 days 16 hours ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 5898 days 1 hour 32 mins 1 sec
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 5899 days 1 hour 32 mins 1 sec
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 5900 days 1 hour 32 mins 1 sec
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 6204 days 1 hour 32 mins 1 sec
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 6205 days 1 hour 32 mins 1 sec
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Sat Jan 05 16:00:00 1980 PST | @ 7300 days 1 hour 32 mins 1 sec
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7301 days 1 hour 32 mins 1 sec
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 10 hours 14 mins 5 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 11 hours 14 mins 4 secs
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 16 hours 14 mins 1 sec
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 20 hours 14 mins 3 secs
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 21 hours 14 mins 2 secs
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7666 days 1 hour 32 mins 1 sec
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Sat Jan 05 16:00:00 1980 PST | @ 7667 days 1 hour 32 mins 1 sec
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Sat Jan 05 16:00:00 1980 PST | @ 7931 days 1 hour 19 mins 20 secs
|
2001-09-28 10:00:11 +02:00
|
|
|
(16 rows)
|
1997-05-11 17:42:09 +02:00
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS difference
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
FROM TEMP_TIMESTAMP d1, TEMP_TIMESTAMP d2
|
|
|
|
ORDER BY timestamp1, timestamp2, difference;
|
2020-12-15 21:54:06 +01:00
|
|
|
timestamp1 | timestamp2 | difference
|
|
|
|
------------------------------+------------------------------+-------------------------------------------
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Thu Jan 01 00:00:00 1970 PST | @ 0
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Wed Feb 28 17:32:01 1996 PST | @ 9554 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Thu Feb 29 17:32:01 1996 PST | @ 9555 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Fri Mar 01 17:32:01 1996 PST | @ 9556 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Mon Dec 30 17:32:01 1996 PST | @ 9860 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Tue Dec 31 17:32:01 1996 PST | @ 9861 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Fri Dec 31 17:32:01 1999 PST | @ 10956 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Sat Jan 01 17:32:01 2000 PST | @ 10957 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 02:14:05 2000 PST | @ 11031 days 2 hours 14 mins 5 secs ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 03:14:04 2000 PST | @ 11031 days 3 hours 14 mins 4 secs ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 08:14:01 2000 PST | @ 11031 days 8 hours 14 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 12:14:03 2000 PST | @ 11031 days 12 hours 14 mins 3 secs ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 13:14:02 2000 PST | @ 11031 days 13 hours 14 mins 2 secs ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Sun Dec 31 17:32:01 2000 PST | @ 11322 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Mon Jan 01 17:32:01 2001 PST | @ 11323 days 17 hours 32 mins 1 sec ago
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | Sat Sep 22 18:19:20 2001 PDT | @ 11587 days 17 hours 19 mins 20 secs ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9554 days 17 hours 32 mins 1 sec
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 0
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 1 day ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 2 days ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 306 days ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 307 days ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1402 days ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1403 days ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1476 days 8 hours 42 mins 4 secs ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1476 days 9 hours 42 mins 3 secs ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1476 days 14 hours 42 mins ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1476 days 18 hours 42 mins 2 secs ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1476 days 19 hours 42 mins 1 sec ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1768 days ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1769 days ago
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 2032 days 23 hours 47 mins 19 secs ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9555 days 17 hours 32 mins 1 sec
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 1 day
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 0
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 1 day ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 305 days ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 306 days ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1401 days ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1402 days ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1475 days 8 hours 42 mins 4 secs ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1475 days 9 hours 42 mins 3 secs ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1475 days 14 hours 42 mins ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1475 days 18 hours 42 mins 2 secs ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1475 days 19 hours 42 mins 1 sec ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1767 days ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1768 days ago
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 2031 days 23 hours 47 mins 19 secs ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9556 days 17 hours 32 mins 1 sec
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 2 days
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 1 day
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 0
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 304 days ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 305 days ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1400 days ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1401 days ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1474 days 8 hours 42 mins 4 secs ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1474 days 9 hours 42 mins 3 secs ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1474 days 14 hours 42 mins ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1474 days 18 hours 42 mins 2 secs ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1474 days 19 hours 42 mins 1 sec ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1766 days ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1767 days ago
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 2030 days 23 hours 47 mins 19 secs ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9860 days 17 hours 32 mins 1 sec
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 306 days
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 305 days
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 304 days
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 0
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 1 day ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1096 days ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1097 days ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1170 days 8 hours 42 mins 4 secs ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1170 days 9 hours 42 mins 3 secs ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1170 days 14 hours 42 mins ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1170 days 18 hours 42 mins 2 secs ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1170 days 19 hours 42 mins 1 sec ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1462 days ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1463 days ago
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 1726 days 23 hours 47 mins 19 secs ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9861 days 17 hours 32 mins 1 sec
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 307 days
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 306 days
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 305 days
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 1 day
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 0
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1095 days ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1096 days ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1169 days 8 hours 42 mins 4 secs ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1169 days 9 hours 42 mins 3 secs ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1169 days 14 hours 42 mins ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1169 days 18 hours 42 mins 2 secs ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1169 days 19 hours 42 mins 1 sec ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1461 days ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1462 days ago
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 1725 days 23 hours 47 mins 19 secs ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Thu Jan 01 00:00:00 1970 PST | @ 10956 days 17 hours 32 mins 1 sec
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Wed Feb 28 17:32:01 1996 PST | @ 1402 days
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Thu Feb 29 17:32:01 1996 PST | @ 1401 days
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Fri Mar 01 17:32:01 1996 PST | @ 1400 days
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Mon Dec 30 17:32:01 1996 PST | @ 1096 days
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Tue Dec 31 17:32:01 1996 PST | @ 1095 days
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Fri Dec 31 17:32:01 1999 PST | @ 0
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Sat Jan 01 17:32:01 2000 PST | @ 1 day ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 02:14:05 2000 PST | @ 74 days 8 hours 42 mins 4 secs ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 03:14:04 2000 PST | @ 74 days 9 hours 42 mins 3 secs ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 08:14:01 2000 PST | @ 74 days 14 hours 42 mins ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 12:14:03 2000 PST | @ 74 days 18 hours 42 mins 2 secs ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 13:14:02 2000 PST | @ 74 days 19 hours 42 mins 1 sec ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Sun Dec 31 17:32:01 2000 PST | @ 366 days ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Mon Jan 01 17:32:01 2001 PST | @ 367 days ago
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | Sat Sep 22 18:19:20 2001 PDT | @ 630 days 23 hours 47 mins 19 secs ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 10957 days 17 hours 32 mins 1 sec
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1403 days
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1402 days
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1401 days
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1097 days
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1096 days
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 1 day
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 0
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 73 days 8 hours 42 mins 4 secs ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 73 days 9 hours 42 mins 3 secs ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 73 days 14 hours 42 mins ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 73 days 18 hours 42 mins 2 secs ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 73 days 19 hours 42 mins 1 sec ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 365 days ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 366 days ago
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 629 days 23 hours 47 mins 19 secs ago
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 2 hours 14 mins 5 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 8 hours 42 mins 4 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 8 hours 42 mins 4 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 8 hours 42 mins 4 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 8 hours 42 mins 4 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 8 hours 42 mins 4 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 8 hours 42 mins 4 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 8 hours 42 mins 4 secs
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 0
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 59 mins 59 secs ago
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 5 hours 59 mins 56 secs ago
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 9 hours 59 mins 58 secs ago
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 10 hours 59 mins 57 secs ago
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 15 hours 17 mins 56 secs ago
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 15 hours 17 mins 56 secs ago
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 15 hours 5 mins 15 secs ago
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 3 hours 14 mins 4 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 9 hours 42 mins 3 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 9 hours 42 mins 3 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 9 hours 42 mins 3 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 9 hours 42 mins 3 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 9 hours 42 mins 3 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 9 hours 42 mins 3 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 9 hours 42 mins 3 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 59 mins 59 secs
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 0
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 4 hours 59 mins 57 secs ago
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 8 hours 59 mins 59 secs ago
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 9 hours 59 mins 58 secs ago
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 14 hours 17 mins 57 secs ago
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 14 hours 17 mins 57 secs ago
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 14 hours 5 mins 16 secs ago
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 8 hours 14 mins 1 sec
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 14 hours 42 mins
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 14 hours 42 mins
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 14 hours 42 mins
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 14 hours 42 mins
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 14 hours 42 mins
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 14 hours 42 mins
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 14 hours 42 mins
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 5 hours 59 mins 56 secs
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 4 hours 59 mins 57 secs
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 0
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 4 hours 2 secs ago
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 5 hours 1 sec ago
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 9 hours 18 mins ago
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 9 hours 18 mins ago
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 9 hours 5 mins 19 secs ago
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 12 hours 14 mins 3 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 18 hours 42 mins 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 18 hours 42 mins 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 18 hours 42 mins 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 18 hours 42 mins 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 18 hours 42 mins 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 18 hours 42 mins 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 18 hours 42 mins 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 9 hours 59 mins 58 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 8 hours 59 mins 59 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 4 hours 2 secs
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 0
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 59 mins 59 secs ago
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 5 hours 17 mins 58 secs ago
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 5 hours 17 mins 58 secs ago
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 5 hours 5 mins 17 secs ago
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 13 hours 14 mins 2 secs
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 19 hours 42 mins 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 19 hours 42 mins 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 19 hours 42 mins 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 19 hours 42 mins 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 19 hours 42 mins 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 19 hours 42 mins 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 19 hours 42 mins 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 10 hours 59 mins 57 secs
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 9 hours 59 mins 58 secs
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 5 hours 1 sec
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 59 mins 59 secs
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 0
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 4 hours 17 mins 59 secs ago
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 4 hours 17 mins 59 secs ago
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 4 hours 5 mins 18 secs ago
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11322 days 17 hours 32 mins 1 sec
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1768 days
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1767 days
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1766 days
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1462 days
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1461 days
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 366 days
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 365 days
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 291 days 15 hours 17 mins 56 secs
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 291 days 14 hours 17 mins 57 secs
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 291 days 9 hours 18 mins
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 291 days 5 hours 17 mins 58 secs
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 291 days 4 hours 17 mins 59 secs
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 0
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 1 day ago
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 264 days 23 hours 47 mins 19 secs ago
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Thu Jan 01 00:00:00 1970 PST | @ 11323 days 17 hours 32 mins 1 sec
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Wed Feb 28 17:32:01 1996 PST | @ 1769 days
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Thu Feb 29 17:32:01 1996 PST | @ 1768 days
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Fri Mar 01 17:32:01 1996 PST | @ 1767 days
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Mon Dec 30 17:32:01 1996 PST | @ 1463 days
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Tue Dec 31 17:32:01 1996 PST | @ 1462 days
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Fri Dec 31 17:32:01 1999 PST | @ 367 days
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Sat Jan 01 17:32:01 2000 PST | @ 366 days
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 02:14:05 2000 PST | @ 292 days 15 hours 17 mins 56 secs
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 03:14:04 2000 PST | @ 292 days 14 hours 17 mins 57 secs
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 08:14:01 2000 PST | @ 292 days 9 hours 18 mins
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 12:14:03 2000 PST | @ 292 days 5 hours 17 mins 58 secs
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 13:14:02 2000 PST | @ 292 days 4 hours 17 mins 59 secs
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Sun Dec 31 17:32:01 2000 PST | @ 1 day
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Mon Jan 01 17:32:01 2001 PST | @ 0
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | Sat Sep 22 18:19:20 2001 PDT | @ 263 days 23 hours 47 mins 19 secs ago
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Thu Jan 01 00:00:00 1970 PST | @ 11587 days 17 hours 19 mins 20 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Wed Feb 28 17:32:01 1996 PST | @ 2032 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Thu Feb 29 17:32:01 1996 PST | @ 2031 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Fri Mar 01 17:32:01 1996 PST | @ 2030 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Mon Dec 30 17:32:01 1996 PST | @ 1726 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Tue Dec 31 17:32:01 1996 PST | @ 1725 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Fri Dec 31 17:32:01 1999 PST | @ 630 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Sat Jan 01 17:32:01 2000 PST | @ 629 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 02:14:05 2000 PST | @ 556 days 15 hours 5 mins 15 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 03:14:04 2000 PST | @ 556 days 14 hours 5 mins 16 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 08:14:01 2000 PST | @ 556 days 9 hours 5 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 12:14:03 2000 PST | @ 556 days 5 hours 5 mins 17 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 13:14:02 2000 PST | @ 556 days 4 hours 5 mins 18 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Sun Dec 31 17:32:01 2000 PST | @ 264 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Mon Jan 01 17:32:01 2001 PST | @ 263 days 23 hours 47 mins 19 secs
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | Sat Sep 22 18:19:20 2001 PDT | @ 0
|
2001-09-28 10:00:11 +02:00
|
|
|
(256 rows)
|
|
|
|
|
2000-01-05 07:06:23 +01:00
|
|
|
--
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
-- Conversions
|
2000-01-05 07:06:23 +01:00
|
|
|
--
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT f1 AS "timestamp", date(f1) AS date
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
FROM TEMP_TIMESTAMP
|
2001-11-21 19:27:25 +01:00
|
|
|
WHERE f1 <> timestamp 'now'
|
2001-10-03 07:29:27 +02:00
|
|
|
ORDER BY date, "timestamp";
|
2020-12-15 21:54:06 +01:00
|
|
|
timestamp | date
|
|
|
|
------------------------------+------------
|
|
|
|
Thu Jan 01 00:00:00 1970 PST | 01-01-1970
|
|
|
|
Wed Feb 28 17:32:01 1996 PST | 02-28-1996
|
|
|
|
Thu Feb 29 17:32:01 1996 PST | 02-29-1996
|
|
|
|
Fri Mar 01 17:32:01 1996 PST | 03-01-1996
|
|
|
|
Mon Dec 30 17:32:01 1996 PST | 12-30-1996
|
|
|
|
Tue Dec 31 17:32:01 1996 PST | 12-31-1996
|
|
|
|
Fri Dec 31 17:32:01 1999 PST | 12-31-1999
|
|
|
|
Sat Jan 01 17:32:01 2000 PST | 01-01-2000
|
|
|
|
Wed Mar 15 02:14:05 2000 PST | 03-15-2000
|
|
|
|
Wed Mar 15 03:14:04 2000 PST | 03-15-2000
|
|
|
|
Wed Mar 15 08:14:01 2000 PST | 03-15-2000
|
|
|
|
Wed Mar 15 12:14:03 2000 PST | 03-15-2000
|
|
|
|
Wed Mar 15 13:14:02 2000 PST | 03-15-2000
|
|
|
|
Sun Dec 31 17:32:01 2000 PST | 12-31-2000
|
|
|
|
Mon Jan 01 17:32:01 2001 PST | 01-01-2001
|
|
|
|
Sat Sep 22 18:19:20 2001 PDT | 09-22-2001
|
2001-09-28 10:00:11 +02:00
|
|
|
(16 rows)
|
1997-05-11 17:42:09 +02:00
|
|
|
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
DROP TABLE TEMP_TIMESTAMP;
|
2000-01-05 07:06:23 +01:00
|
|
|
--
|
Prevent internal overflows in date-vs-timestamp and related comparisons.
The date-vs-timestamp, date-vs-timestamptz, and timestamp-vs-timestamptz
comparators all worked by promoting the first type to the second and
then doing a simple same-type comparison. This works fine, except
when the conversion result is out of range, in which case we throw an
entirely avoidable error. The sources of such failures are
(a) type date can represent dates much farther in the future than
the timestamp types can;
(b) timezone rotation might cause a just-in-range timestamp value to
become a just-out-of-range timestamptz value.
Up to now we just ignored these corner-case issues, but now we have
an actual user complaint (bug #16657 from Huss EL-Sheikh), so let's
do something about it.
It turns out that commit 52ad1e659 already built all the necessary
infrastructure to support error-free comparisons, but neglected to
actually use it in the main-line code paths. Fix that, do a little
bit of code style review, and remove the now-duplicate logic in
jsonpath_exec.c.
Back-patch to v13 where 52ad1e659 came in. We could take this back
further by back-patching said infrastructure, but given the small
number of complaints so far, I don't feel a great need to.
Discussion: https://postgr.es/m/16657-cde2f876d8cc7971@postgresql.org
2020-10-07 23:10:26 +02:00
|
|
|
-- Comparisons between datetime types, especially overflow cases
|
|
|
|
---
|
|
|
|
SELECT '2202020-10-05'::date::timestamp; -- fail
|
|
|
|
ERROR: date out of range for timestamp
|
|
|
|
SELECT '2202020-10-05'::date > '2020-10-05'::timestamp as t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '2020-10-05'::timestamp > '2202020-10-05'::date as f;
|
|
|
|
f
|
|
|
|
---
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '2202020-10-05'::date::timestamptz; -- fail
|
|
|
|
ERROR: date out of range for timestamp
|
|
|
|
SELECT '2202020-10-05'::date > '2020-10-05'::timestamptz as t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
|
|
|
|
f
|
|
|
|
---
|
|
|
|
f
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- This conversion may work depending on timezone
|
|
|
|
SELECT '4714-11-24 BC'::date::timestamptz;
|
|
|
|
timestamptz
|
|
|
|
---------------------------------
|
|
|
|
Mon Nov 24 00:00:00 4714 PST BC
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SET TimeZone = 'UTC-2';
|
|
|
|
SELECT '4714-11-24 BC'::date::timestamptz; -- fail
|
|
|
|
ERROR: date out of range for timestamp
|
|
|
|
SELECT '4714-11-24 BC'::date < '2020-10-05'::timestamptz as t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::date as t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '4714-11-24 BC'::timestamp < '2020-10-05'::timestamptz as t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::timestamp as t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
RESET TimeZone;
|
2022-02-08 21:30:38 +01:00
|
|
|
--
|
|
|
|
-- Tests for BETWEEN
|
|
|
|
--
|
|
|
|
explain (costs off)
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 between '1997-01-01' and '1998-01-01';
|
|
|
|
QUERY PLAN
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
Aggregate
|
|
|
|
-> Seq Scan on date_tbl
|
|
|
|
Filter: ((f1 >= '01-01-1997'::date) AND (f1 <= '01-01-1998'::date))
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 between '1997-01-01' and '1998-01-01';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
3
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
explain (costs off)
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 not between '1997-01-01' and '1998-01-01';
|
|
|
|
QUERY PLAN
|
|
|
|
--------------------------------------------------------------------------
|
|
|
|
Aggregate
|
|
|
|
-> Seq Scan on date_tbl
|
|
|
|
Filter: ((f1 < '01-01-1997'::date) OR (f1 > '01-01-1998'::date))
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 not between '1997-01-01' and '1998-01-01';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
13
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
explain (costs off)
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 between symmetric '1997-01-01' and '1998-01-01';
|
|
|
|
QUERY PLAN
|
|
|
|
----------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
Aggregate
|
|
|
|
-> Seq Scan on date_tbl
|
|
|
|
Filter: (((f1 >= '01-01-1997'::date) AND (f1 <= '01-01-1998'::date)) OR ((f1 >= '01-01-1998'::date) AND (f1 <= '01-01-1997'::date)))
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 between symmetric '1997-01-01' and '1998-01-01';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
3
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
explain (costs off)
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 not between symmetric '1997-01-01' and '1998-01-01';
|
|
|
|
QUERY PLAN
|
|
|
|
-----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
Aggregate
|
|
|
|
-> Seq Scan on date_tbl
|
|
|
|
Filter: (((f1 < '01-01-1997'::date) OR (f1 > '01-01-1998'::date)) AND ((f1 < '01-01-1998'::date) OR (f1 > '01-01-1997'::date)))
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
select count(*) from date_tbl
|
|
|
|
where f1 not between symmetric '1997-01-01' and '1998-01-01';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
13
|
|
|
|
(1 row)
|
|
|
|
|
Prevent internal overflows in date-vs-timestamp and related comparisons.
The date-vs-timestamp, date-vs-timestamptz, and timestamp-vs-timestamptz
comparators all worked by promoting the first type to the second and
then doing a simple same-type comparison. This works fine, except
when the conversion result is out of range, in which case we throw an
entirely avoidable error. The sources of such failures are
(a) type date can represent dates much farther in the future than
the timestamp types can;
(b) timezone rotation might cause a just-in-range timestamp value to
become a just-out-of-range timestamptz value.
Up to now we just ignored these corner-case issues, but now we have
an actual user complaint (bug #16657 from Huss EL-Sheikh), so let's
do something about it.
It turns out that commit 52ad1e659 already built all the necessary
infrastructure to support error-free comparisons, but neglected to
actually use it in the main-line code paths. Fix that, do a little
bit of code style review, and remove the now-duplicate logic in
jsonpath_exec.c.
Back-patch to v13 where 52ad1e659 came in. We could take this back
further by back-patching said infrastructure, but given the small
number of complaints so far, I don't feel a great need to.
Discussion: https://postgr.es/m/16657-cde2f876d8cc7971@postgresql.org
2020-10-07 23:10:26 +02:00
|
|
|
--
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
-- Formats
|
2000-01-05 07:06:23 +01:00
|
|
|
--
|
|
|
|
SET DateStyle TO 'US,Postgres';
|
|
|
|
SHOW DateStyle;
|
2003-07-29 02:03:19 +02:00
|
|
|
DateStyle
|
|
|
|
---------------
|
|
|
|
Postgres, MDY
|
2002-07-20 08:32:53 +02:00
|
|
|
(1 row)
|
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 AS us_postgres FROM TIMESTAMP_TBL;
|
|
|
|
us_postgres
|
|
|
|
-----------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
Thu Jan 01 00:00:00 1970
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:02 1997
|
|
|
|
Mon Feb 10 17:32:01.4 1997
|
|
|
|
Mon Feb 10 17:32:01.5 1997
|
|
|
|
Mon Feb 10 17:32:01.6 1997
|
|
|
|
Thu Jan 02 00:00:00 1997
|
|
|
|
Thu Jan 02 03:04:05 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Tue Jun 10 17:32:01 1997
|
|
|
|
Sat Sep 22 18:19:20 2001
|
|
|
|
Wed Mar 15 08:14:01 2000
|
|
|
|
Wed Mar 15 13:14:02 2000
|
|
|
|
Wed Mar 15 12:14:03 2000
|
|
|
|
Wed Mar 15 03:14:04 2000
|
|
|
|
Wed Mar 15 02:14:05 2000
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:00 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Tue Jun 10 18:32:01 1997
|
|
|
|
Mon Feb 10 17:32:01 1997
|
|
|
|
Tue Feb 11 17:32:01 1997
|
|
|
|
Wed Feb 12 17:32:01 1997
|
|
|
|
Thu Feb 13 17:32:01 1997
|
|
|
|
Fri Feb 14 17:32:01 1997
|
|
|
|
Sat Feb 15 17:32:01 1997
|
|
|
|
Sun Feb 16 17:32:01 1997
|
|
|
|
Tue Feb 16 17:32:01 0097 BC
|
|
|
|
Sat Feb 16 17:32:01 0097
|
|
|
|
Thu Feb 16 17:32:01 0597
|
|
|
|
Tue Feb 16 17:32:01 1097
|
|
|
|
Sat Feb 16 17:32:01 1697
|
|
|
|
Thu Feb 16 17:32:01 1797
|
|
|
|
Tue Feb 16 17:32:01 1897
|
|
|
|
Sun Feb 16 17:32:01 1997
|
|
|
|
Sat Feb 16 17:32:01 2097
|
|
|
|
Wed Feb 28 17:32:01 1996
|
|
|
|
Thu Feb 29 17:32:01 1996
|
|
|
|
Fri Mar 01 17:32:01 1996
|
|
|
|
Mon Dec 30 17:32:01 1996
|
|
|
|
Tue Dec 31 17:32:01 1996
|
|
|
|
Wed Jan 01 17:32:01 1997
|
|
|
|
Fri Feb 28 17:32:01 1997
|
|
|
|
Sat Mar 01 17:32:01 1997
|
|
|
|
Tue Dec 30 17:32:01 1997
|
|
|
|
Wed Dec 31 17:32:01 1997
|
|
|
|
Fri Dec 31 17:32:01 1999
|
|
|
|
Sat Jan 01 17:32:01 2000
|
|
|
|
Sun Dec 31 17:32:01 2000
|
|
|
|
Mon Jan 01 17:32:01 2001
|
2006-07-06 03:46:38 +02:00
|
|
|
(65 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2000-01-05 07:06:23 +01:00
|
|
|
SET DateStyle TO 'US,ISO';
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 AS us_iso FROM TIMESTAMP_TBL;
|
|
|
|
us_iso
|
|
|
|
------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
1970-01-01 00:00:00
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:02
|
|
|
|
1997-02-10 17:32:01.4
|
|
|
|
1997-02-10 17:32:01.5
|
|
|
|
1997-02-10 17:32:01.6
|
|
|
|
1997-01-02 00:00:00
|
|
|
|
1997-01-02 03:04:05
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-06-10 17:32:01
|
|
|
|
2001-09-22 18:19:20
|
|
|
|
2000-03-15 08:14:01
|
|
|
|
2000-03-15 13:14:02
|
|
|
|
2000-03-15 12:14:03
|
|
|
|
2000-03-15 03:14:04
|
|
|
|
2000-03-15 02:14:05
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:00
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-06-10 18:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-11 17:32:01
|
|
|
|
1997-02-12 17:32:01
|
|
|
|
1997-02-13 17:32:01
|
|
|
|
1997-02-14 17:32:01
|
|
|
|
1997-02-15 17:32:01
|
|
|
|
1997-02-16 17:32:01
|
|
|
|
0097-02-16 17:32:01 BC
|
|
|
|
0097-02-16 17:32:01
|
|
|
|
0597-02-16 17:32:01
|
|
|
|
1097-02-16 17:32:01
|
|
|
|
1697-02-16 17:32:01
|
|
|
|
1797-02-16 17:32:01
|
|
|
|
1897-02-16 17:32:01
|
|
|
|
1997-02-16 17:32:01
|
|
|
|
2097-02-16 17:32:01
|
|
|
|
1996-02-28 17:32:01
|
|
|
|
1996-02-29 17:32:01
|
|
|
|
1996-03-01 17:32:01
|
|
|
|
1996-12-30 17:32:01
|
|
|
|
1996-12-31 17:32:01
|
|
|
|
1997-01-01 17:32:01
|
|
|
|
1997-02-28 17:32:01
|
|
|
|
1997-03-01 17:32:01
|
|
|
|
1997-12-30 17:32:01
|
|
|
|
1997-12-31 17:32:01
|
|
|
|
1999-12-31 17:32:01
|
|
|
|
2000-01-01 17:32:01
|
|
|
|
2000-12-31 17:32:01
|
|
|
|
2001-01-01 17:32:01
|
2006-07-06 03:46:38 +02:00
|
|
|
(65 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2000-01-05 07:06:23 +01:00
|
|
|
SET DateStyle TO 'US,SQL';
|
|
|
|
SHOW DateStyle;
|
2003-07-15 21:19:56 +02:00
|
|
|
DateStyle
|
|
|
|
-----------
|
2003-07-29 02:03:19 +02:00
|
|
|
SQL, MDY
|
2002-07-20 08:32:53 +02:00
|
|
|
(1 row)
|
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 AS us_sql FROM TIMESTAMP_TBL;
|
|
|
|
us_sql
|
|
|
|
------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
01/01/1970 00:00:00
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:02
|
|
|
|
02/10/1997 17:32:01.4
|
|
|
|
02/10/1997 17:32:01.5
|
|
|
|
02/10/1997 17:32:01.6
|
|
|
|
01/02/1997 00:00:00
|
|
|
|
01/02/1997 03:04:05
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
06/10/1997 17:32:01
|
|
|
|
09/22/2001 18:19:20
|
|
|
|
03/15/2000 08:14:01
|
|
|
|
03/15/2000 13:14:02
|
|
|
|
03/15/2000 12:14:03
|
|
|
|
03/15/2000 03:14:04
|
|
|
|
03/15/2000 02:14:05
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:00
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
06/10/1997 18:32:01
|
|
|
|
02/10/1997 17:32:01
|
|
|
|
02/11/1997 17:32:01
|
|
|
|
02/12/1997 17:32:01
|
|
|
|
02/13/1997 17:32:01
|
|
|
|
02/14/1997 17:32:01
|
|
|
|
02/15/1997 17:32:01
|
|
|
|
02/16/1997 17:32:01
|
|
|
|
02/16/0097 17:32:01 BC
|
|
|
|
02/16/0097 17:32:01
|
|
|
|
02/16/0597 17:32:01
|
|
|
|
02/16/1097 17:32:01
|
|
|
|
02/16/1697 17:32:01
|
|
|
|
02/16/1797 17:32:01
|
|
|
|
02/16/1897 17:32:01
|
|
|
|
02/16/1997 17:32:01
|
|
|
|
02/16/2097 17:32:01
|
|
|
|
02/28/1996 17:32:01
|
|
|
|
02/29/1996 17:32:01
|
|
|
|
03/01/1996 17:32:01
|
|
|
|
12/30/1996 17:32:01
|
|
|
|
12/31/1996 17:32:01
|
|
|
|
01/01/1997 17:32:01
|
|
|
|
02/28/1997 17:32:01
|
|
|
|
03/01/1997 17:32:01
|
|
|
|
12/30/1997 17:32:01
|
|
|
|
12/31/1997 17:32:01
|
|
|
|
12/31/1999 17:32:01
|
|
|
|
01/01/2000 17:32:01
|
|
|
|
12/31/2000 17:32:01
|
|
|
|
01/01/2001 17:32:01
|
2006-07-06 03:46:38 +02:00
|
|
|
(65 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2000-01-05 07:06:23 +01:00
|
|
|
SET DateStyle TO 'European,Postgres';
|
|
|
|
SHOW DateStyle;
|
2003-07-29 02:03:19 +02:00
|
|
|
DateStyle
|
|
|
|
---------------
|
|
|
|
Postgres, DMY
|
2002-07-20 08:32:53 +02:00
|
|
|
(1 row)
|
|
|
|
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
|
|
|
|
SELECT count(*) as one FROM TIMESTAMP_TBL WHERE d1 = 'Jun 13 1957';
|
2000-01-05 07:06:23 +01:00
|
|
|
one
|
|
|
|
-----
|
All regression tests pass except for rules.sql (unrelated).
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:27:27 +01:00
|
|
|
1
|
1997-07-02 03:34:24 +02:00
|
|
|
(1 row)
|
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 AS european_postgres FROM TIMESTAMP_TBL;
|
|
|
|
european_postgres
|
|
|
|
-----------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
Thu 01 Jan 00:00:00 1970
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:02 1997
|
|
|
|
Mon 10 Feb 17:32:01.4 1997
|
|
|
|
Mon 10 Feb 17:32:01.5 1997
|
|
|
|
Mon 10 Feb 17:32:01.6 1997
|
|
|
|
Thu 02 Jan 00:00:00 1997
|
|
|
|
Thu 02 Jan 03:04:05 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Tue 10 Jun 17:32:01 1997
|
|
|
|
Sat 22 Sep 18:19:20 2001
|
|
|
|
Wed 15 Mar 08:14:01 2000
|
|
|
|
Wed 15 Mar 13:14:02 2000
|
|
|
|
Wed 15 Mar 12:14:03 2000
|
|
|
|
Wed 15 Mar 03:14:04 2000
|
|
|
|
Wed 15 Mar 02:14:05 2000
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:00 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Tue 10 Jun 18:32:01 1997
|
|
|
|
Mon 10 Feb 17:32:01 1997
|
|
|
|
Tue 11 Feb 17:32:01 1997
|
|
|
|
Wed 12 Feb 17:32:01 1997
|
|
|
|
Thu 13 Feb 17:32:01 1997
|
|
|
|
Fri 14 Feb 17:32:01 1997
|
|
|
|
Sat 15 Feb 17:32:01 1997
|
|
|
|
Sun 16 Feb 17:32:01 1997
|
|
|
|
Tue 16 Feb 17:32:01 0097 BC
|
|
|
|
Sat 16 Feb 17:32:01 0097
|
|
|
|
Thu 16 Feb 17:32:01 0597
|
|
|
|
Tue 16 Feb 17:32:01 1097
|
|
|
|
Sat 16 Feb 17:32:01 1697
|
|
|
|
Thu 16 Feb 17:32:01 1797
|
|
|
|
Tue 16 Feb 17:32:01 1897
|
|
|
|
Sun 16 Feb 17:32:01 1997
|
|
|
|
Sat 16 Feb 17:32:01 2097
|
|
|
|
Wed 28 Feb 17:32:01 1996
|
|
|
|
Thu 29 Feb 17:32:01 1996
|
|
|
|
Fri 01 Mar 17:32:01 1996
|
|
|
|
Mon 30 Dec 17:32:01 1996
|
|
|
|
Tue 31 Dec 17:32:01 1996
|
|
|
|
Wed 01 Jan 17:32:01 1997
|
|
|
|
Fri 28 Feb 17:32:01 1997
|
|
|
|
Sat 01 Mar 17:32:01 1997
|
|
|
|
Tue 30 Dec 17:32:01 1997
|
|
|
|
Wed 31 Dec 17:32:01 1997
|
|
|
|
Fri 31 Dec 17:32:01 1999
|
|
|
|
Sat 01 Jan 17:32:01 2000
|
|
|
|
Sun 31 Dec 17:32:01 2000
|
|
|
|
Mon 01 Jan 17:32:01 2001
|
|
|
|
Thu 13 Jun 00:00:00 1957
|
2006-07-06 03:46:38 +02:00
|
|
|
(66 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2000-01-05 07:06:23 +01:00
|
|
|
SET DateStyle TO 'European,ISO';
|
|
|
|
SHOW DateStyle;
|
2003-07-29 02:03:19 +02:00
|
|
|
DateStyle
|
|
|
|
-----------
|
|
|
|
ISO, DMY
|
2002-07-20 08:32:53 +02:00
|
|
|
(1 row)
|
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 AS european_iso FROM TIMESTAMP_TBL;
|
|
|
|
european_iso
|
|
|
|
------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
1970-01-01 00:00:00
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:02
|
|
|
|
1997-02-10 17:32:01.4
|
|
|
|
1997-02-10 17:32:01.5
|
|
|
|
1997-02-10 17:32:01.6
|
|
|
|
1997-01-02 00:00:00
|
|
|
|
1997-01-02 03:04:05
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-06-10 17:32:01
|
|
|
|
2001-09-22 18:19:20
|
|
|
|
2000-03-15 08:14:01
|
|
|
|
2000-03-15 13:14:02
|
|
|
|
2000-03-15 12:14:03
|
|
|
|
2000-03-15 03:14:04
|
|
|
|
2000-03-15 02:14:05
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:00
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-06-10 18:32:01
|
|
|
|
1997-02-10 17:32:01
|
|
|
|
1997-02-11 17:32:01
|
|
|
|
1997-02-12 17:32:01
|
|
|
|
1997-02-13 17:32:01
|
|
|
|
1997-02-14 17:32:01
|
|
|
|
1997-02-15 17:32:01
|
|
|
|
1997-02-16 17:32:01
|
|
|
|
0097-02-16 17:32:01 BC
|
|
|
|
0097-02-16 17:32:01
|
|
|
|
0597-02-16 17:32:01
|
|
|
|
1097-02-16 17:32:01
|
|
|
|
1697-02-16 17:32:01
|
|
|
|
1797-02-16 17:32:01
|
|
|
|
1897-02-16 17:32:01
|
|
|
|
1997-02-16 17:32:01
|
|
|
|
2097-02-16 17:32:01
|
|
|
|
1996-02-28 17:32:01
|
|
|
|
1996-02-29 17:32:01
|
|
|
|
1996-03-01 17:32:01
|
|
|
|
1996-12-30 17:32:01
|
|
|
|
1996-12-31 17:32:01
|
|
|
|
1997-01-01 17:32:01
|
|
|
|
1997-02-28 17:32:01
|
|
|
|
1997-03-01 17:32:01
|
|
|
|
1997-12-30 17:32:01
|
|
|
|
1997-12-31 17:32:01
|
|
|
|
1999-12-31 17:32:01
|
|
|
|
2000-01-01 17:32:01
|
|
|
|
2000-12-31 17:32:01
|
|
|
|
2001-01-01 17:32:01
|
|
|
|
1957-06-13 00:00:00
|
2006-07-06 03:46:38 +02:00
|
|
|
(66 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2000-01-05 07:06:23 +01:00
|
|
|
SET DateStyle TO 'European,SQL';
|
|
|
|
SHOW DateStyle;
|
2003-07-29 02:03:19 +02:00
|
|
|
DateStyle
|
|
|
|
-----------
|
|
|
|
SQL, DMY
|
2002-07-20 08:32:53 +02:00
|
|
|
(1 row)
|
|
|
|
|
2020-12-15 21:54:06 +01:00
|
|
|
SELECT d1 AS european_sql FROM TIMESTAMP_TBL;
|
|
|
|
european_sql
|
|
|
|
------------------------
|
|
|
|
-infinity
|
|
|
|
infinity
|
|
|
|
01/01/1970 00:00:00
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:02
|
|
|
|
10/02/1997 17:32:01.4
|
|
|
|
10/02/1997 17:32:01.5
|
|
|
|
10/02/1997 17:32:01.6
|
|
|
|
02/01/1997 00:00:00
|
|
|
|
02/01/1997 03:04:05
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/06/1997 17:32:01
|
|
|
|
22/09/2001 18:19:20
|
|
|
|
15/03/2000 08:14:01
|
|
|
|
15/03/2000 13:14:02
|
|
|
|
15/03/2000 12:14:03
|
|
|
|
15/03/2000 03:14:04
|
|
|
|
15/03/2000 02:14:05
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:00
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
10/06/1997 18:32:01
|
|
|
|
10/02/1997 17:32:01
|
|
|
|
11/02/1997 17:32:01
|
|
|
|
12/02/1997 17:32:01
|
|
|
|
13/02/1997 17:32:01
|
|
|
|
14/02/1997 17:32:01
|
|
|
|
15/02/1997 17:32:01
|
|
|
|
16/02/1997 17:32:01
|
|
|
|
16/02/0097 17:32:01 BC
|
|
|
|
16/02/0097 17:32:01
|
|
|
|
16/02/0597 17:32:01
|
|
|
|
16/02/1097 17:32:01
|
|
|
|
16/02/1697 17:32:01
|
|
|
|
16/02/1797 17:32:01
|
|
|
|
16/02/1897 17:32:01
|
|
|
|
16/02/1997 17:32:01
|
|
|
|
16/02/2097 17:32:01
|
|
|
|
28/02/1996 17:32:01
|
|
|
|
29/02/1996 17:32:01
|
|
|
|
01/03/1996 17:32:01
|
|
|
|
30/12/1996 17:32:01
|
|
|
|
31/12/1996 17:32:01
|
|
|
|
01/01/1997 17:32:01
|
|
|
|
28/02/1997 17:32:01
|
|
|
|
01/03/1997 17:32:01
|
|
|
|
30/12/1997 17:32:01
|
|
|
|
31/12/1997 17:32:01
|
|
|
|
31/12/1999 17:32:01
|
|
|
|
01/01/2000 17:32:01
|
|
|
|
31/12/2000 17:32:01
|
|
|
|
01/01/2001 17:32:01
|
|
|
|
13/06/1957 00:00:00
|
2006-07-06 03:46:38 +02:00
|
|
|
(66 rows)
|
2001-09-28 10:00:11 +02:00
|
|
|
|
2000-01-05 07:06:23 +01:00
|
|
|
RESET DateStyle;
|
2008-09-11 19:32:34 +02:00
|
|
|
--
|
|
|
|
-- to_timestamp()
|
|
|
|
--
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Feb 16 08:14:30 0097 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD FMHH:FMMI:FMSS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Feb 16 08:14:30 0097 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
SELECT to_timestamp('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Fri Mar 18 23:38:15 2011 PDT
|
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('1985 January 12', 'YYYY FMMonth DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 12 00:00:00 1985 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
SELECT to_timestamp('1985 FMMonth 12', 'YYYY "FMMonth" DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 12 00:00:00 1985 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('1985 \ 12', 'YYYY \\ DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 12 00:00:00 1985 PST
|
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('My birthday-> Year: 1976, Month: May, Day: 16',
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
'"My birthday-> Year:" YYYY, "Month:" FMMonth, "Day:" DD');
|
2009-06-22 19:54:30 +02:00
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun May 16 00:00:00 1976 PDT
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Aug 21 00:00:00 1582 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('15 "text between quote marks" 98 54 45',
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
E'HH24 "\\"text between quote marks\\"" YY MI SS');
|
2009-06-22 19:54:30 +02:00
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jan 01 15:54:45 1998 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('05121445482000', 'MMDDHH24MISSYYYY');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Fri May 12 14:45:48 2000 PDT
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('2000January09Sunday', 'YYYYFMMonthDDFMDay');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Jan 09 00:00:00 2000 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('97/Feb/16', 'YYMonDD');
|
Clean up formatting.c's logic for matching constant strings.
seq_search(), which is used to match input substrings to constants
such as month and day names, had a lot of bizarre and unnecessary
behaviors. It was mostly possible to avert our eyes from that before,
but we don't want to duplicate those behaviors in the upcoming patch
to allow recognition of non-English month and day names. So it's time
to clean this up. In particular:
* seq_search scribbled on the input string, which is a pretty dangerous
thing to do, especially in the badly underdocumented way it was done here.
Fortunately the input string is a temporary copy, but that was being made
three subroutine levels away, making it something easy to break
accidentally. The behavior is externally visible nonetheless, in the form
of odd case-folding in error reports about unrecognized month/day names.
The scribbling is evidently being done to save a few calls to pg_tolower,
but that's such a cheap function (at least for ASCII data) that it's
pretty pointless to worry about. In HEAD I switched it to be
pg_ascii_tolower to ensure it is cheap in all cases; but there are corner
cases in Turkish where this'd change behavior, so leave it as pg_tolower
in the back branches.
* seq_search insisted on knowing the case form (all-upper, all-lower,
or initcap) of the constant strings, so that it didn't have to case-fold
them to perform case-insensitive comparisons. This likewise seems like
excessive micro-optimization, given that pg_tolower is certainly very
cheap for ASCII data. It seems unsafe to assume that we know the case
form that will come out of pg_locale.c for localized month/day names, so
it's better just to define the comparison rule as "downcase all strings
before comparing". (The choice between downcasing and upcasing is
arbitrary so far as English is concerned, but it might not be in other
locales, so follow citext's lead here.)
* seq_search also had a parameter that'd cause it to report a match
after a maximum number of characters, even if the constant string were
longer than that. This was not actually used because no caller passed
a value small enough to cut off a comparison. Replicating that behavior
for localized month/day names seems expensive as well as useless, so
let's get rid of that too.
* from_char_seq_search used the maximum-length parameter to truncate
the input string in error reports about not finding a matching name.
This leads to rather confusing reports in many cases. Worse, it is
outright dangerous if the input string isn't all-ASCII, because we
risk truncating the string in the middle of a multibyte character.
That'd lead either to delivering an illegible error message to the
client, or to encoding-conversion failures that obscure the actual
data problem. Get rid of that in favor of truncating at whitespace
if any (a suggestion due to Alvaro Herrera).
In addition to fixing these things, I const-ified the input string
pointers of DCH_from_char and its subroutines, to make sure there
aren't any other scribbling-on-input problems.
The risk of generating a badly-encoded error message seems like
enough of a bug to justify back-patching, so patch all supported
branches.
Discussion: https://postgr.es/m/29432.1579731087@sss.pgh.pa.us
2020-01-23 19:42:09 +01:00
|
|
|
ERROR: invalid value "/Feb/16" for "Mon"
|
2008-09-11 19:32:34 +02:00
|
|
|
DETAIL: The given value did not match any of the allowed values for this field.
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
SELECT to_timestamp('97/Feb/16', 'YY:Mon:DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Feb 16 00:00:00 1997 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('97/Feb/16', 'FXYY:Mon:DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Feb 16 00:00:00 1997 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('97/Feb/16', 'FXYY/Mon/DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Feb 16 00:00:00 1997 PST
|
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('19971116', 'YYYYMMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Nov 16 00:00:00 1997 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('20000-1116', 'YYYY-MMDD');
|
|
|
|
to_timestamp
|
|
|
|
-------------------------------
|
|
|
|
Thu Nov 16 00:00:00 20000 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
Make to_timestamp() and to_date() range-check fields of their input.
Historically, something like to_date('2009-06-40','YYYY-MM-DD') would
return '2009-07-10' because there was no prohibition on out-of-range
month or day numbers. This has been widely panned, and it also turns
out that Oracle throws an error in such cases. Since these functions
are nominally Oracle-compatibility features, let's change that.
There's no particular restriction on year (modulo the fact that the
scanner may not believe that more than 4 digits are year digits,
a matter to be addressed separately if at all). But we now check month,
day, hour, minute, second, and fractional-second fields, as well as
day-of-year and second-of-day fields if those are used.
Currently, no checks are made on ISO-8601-style week numbers or day
numbers; it's not very clear what the appropriate rules would be there,
and they're probably so little used that it's not worth sweating over.
Artur Zakirov, reviewed by Amul Sul, further adjustments by me
Discussion: <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com>
See-Also: <57786490.9010201@wars-nicht.de>
2016-09-28 20:36:04 +02:00
|
|
|
SELECT to_timestamp('1997 AD 11 16', 'YYYY BC MM DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Nov 16 00:00:00 1997 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('1997 BC 11 16', 'YYYY BC MM DD');
|
|
|
|
to_timestamp
|
|
|
|
---------------------------------
|
|
|
|
Tue Nov 16 00:00:00 1997 PST BC
|
|
|
|
(1 row)
|
|
|
|
|
2020-01-23 22:15:32 +01:00
|
|
|
SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Nov 16 00:00:00 1997 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('1997 B.C. 11 16', 'YYYY B.C. MM DD');
|
|
|
|
to_timestamp
|
|
|
|
---------------------------------
|
|
|
|
Tue Nov 16 00:00:00 1997 PST BC
|
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('9-1116', 'Y-MMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Mon Nov 16 00:00:00 2009 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('95-1116', 'YY-MMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Nov 16 00:00:00 1995 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('995-1116', 'YYY-MMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Nov 16 00:00:00 1995 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('2005426', 'YYYYWWD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Oct 15 00:00:00 2005 PDT
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('2005300', 'YYYYDDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Oct 27 00:00:00 2005 PDT
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('2005527', 'IYYYIWID');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Jan 01 00:00:00 2006 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('005527', 'IYYIWID');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Jan 01 00:00:00 2006 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('05527', 'IYIWID');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Jan 01 00:00:00 2006 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('5527', 'IIWID');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Jan 01 00:00:00 2006 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('2005364', 'IYYYIDDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Jan 01 00:00:00 2006 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('20050302', 'YYYYMMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Wed Mar 02 00:00:00 2005 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('2005 03 02', 'YYYYMMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Wed Mar 02 00:00:00 2005 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp(' 2005 03 02', 'YYYYMMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Wed Mar 02 00:00:00 2005 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp(' 20050302', 'YYYYMMDD');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Wed Mar 02 00:00:00 2005 PST
|
2008-09-11 19:32:34 +02:00
|
|
|
(1 row)
|
|
|
|
|
Make to_timestamp() and to_date() range-check fields of their input.
Historically, something like to_date('2009-06-40','YYYY-MM-DD') would
return '2009-07-10' because there was no prohibition on out-of-range
month or day numbers. This has been widely panned, and it also turns
out that Oracle throws an error in such cases. Since these functions
are nominally Oracle-compatibility features, let's change that.
There's no particular restriction on year (modulo the fact that the
scanner may not believe that more than 4 digits are year digits,
a matter to be addressed separately if at all). But we now check month,
day, hour, minute, second, and fractional-second fields, as well as
day-of-year and second-of-day fields if those are used.
Currently, no checks are made on ISO-8601-style week numbers or day
numbers; it's not very clear what the appropriate rules would be there,
and they're probably so little used that it's not worth sweating over.
Artur Zakirov, reviewed by Amul Sul, further adjustments by me
Discussion: <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com>
See-Also: <57786490.9010201@wars-nicht.de>
2016-09-28 20:36:04 +02:00
|
|
|
SELECT to_timestamp('2011-12-18 11:38 AM', 'YYYY-MM-DD HH12:MI PM');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 11:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 PM', 'YYYY-MM-DD HH12:MI PM');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 23:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
2020-01-23 22:15:32 +01:00
|
|
|
SELECT to_timestamp('2011-12-18 11:38 A.M.', 'YYYY-MM-DD HH12:MI P.M.');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 11:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 P.M.', 'YYYY-MM-DD HH12:MI P.M.');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 23:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
2018-01-09 20:25:05 +01:00
|
|
|
SELECT to_timestamp('2011-12-18 11:38 +05', 'YYYY-MM-DD HH12:MI TZH');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Dec 17 22:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI TZH');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 08:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 +05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Dec 17 22:18:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 -05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 08:58:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 20', 'YYYY-MM-DD HH12:MI TZM');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 03:18:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
Support TZ and OF format codes in to_timestamp().
Formerly, these were only supported in to_char(), but there seems
little reason for that restriction. We should at least have enough
support to permit round-tripping the output of to_char().
In that spirit, TZ accepts either zone abbreviations or numeric
(HH or HH:MM) offsets, which are the cases that to_char() can output.
In an ideal world we'd make it take full zone names too, but
that seems like it'd introduce an unreasonable amount of ambiguity,
since the rules for POSIX-spec zone names are so lax.
OF is a subset of this, accepting only HH or HH:MM.
One small benefit of this improvement is that we can simplify
jsonpath's executeDateTimeMethod function, which no longer needs
to consider the HH and HH:MM cases separately. Moreover, letting
it accept zone abbreviations means it will accept "Z" to mean UTC,
which is emitted by JSON.stringify() for example.
Patch by me, reviewed by Aleksander Alekseev and Daniel Gustafsson
Discussion: https://postgr.es/m/1681086.1686673242@sss.pgh.pa.us
2024-01-25 23:47:08 +01:00
|
|
|
SELECT to_timestamp('2011-12-18 11:38 EST', 'YYYY-MM-DD HH12:MI TZ');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 08:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI TZ');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 08:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 +01:30', 'YYYY-MM-DD HH12:MI TZ');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 02:08:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 MSK', 'YYYY-MM-DD HH12:MI TZ'); -- dyntz
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Dec 17 23:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38ESTFOO24', 'YYYY-MM-DD HH12:MITZFOOSS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 08:38:24 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38-05FOO24', 'YYYY-MM-DD HH12:MITZFOOSS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 08:38:24 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 JUNK', 'YYYY-MM-DD HH12:MI TZ'); -- error
|
|
|
|
ERROR: invalid value "JUNK" for "TZ"
|
|
|
|
DETAIL: Time zone abbreviation is not recognized.
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 ...', 'YYYY-MM-DD HH12:MI TZ'); -- error
|
|
|
|
ERROR: invalid value ".." for "TZ"
|
|
|
|
DETAIL: Value must be an integer.
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI OF');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 08:38:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 +01:30', 'YYYY-MM-DD HH12:MI OF');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 02:08:00 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 +xyz', 'YYYY-MM-DD HH12:MI OF'); -- error
|
|
|
|
ERROR: invalid value "xy" for "OF"
|
|
|
|
DETAIL: Value must be an integer.
|
|
|
|
SELECT to_timestamp('2011-12-18 11:38 +01:xyz', 'YYYY-MM-DD HH12:MI OF'); -- error
|
|
|
|
ERROR: invalid value "xy" for "OF"
|
|
|
|
DETAIL: Value must be an integer.
|
2020-01-23 22:15:32 +01:00
|
|
|
SELECT to_timestamp('2018-11-02 12:34:56.025', 'YYYY-MM-DD HH24:MI:SS.MS');
|
|
|
|
to_timestamp
|
|
|
|
----------------------------------
|
|
|
|
Fri Nov 02 12:34:56.025 2018 PDT
|
|
|
|
(1 row)
|
|
|
|
|
2019-09-16 20:02:14 +02:00
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
i | to_timestamp
|
|
|
|
---+------------------------------
|
|
|
|
1 | Fri Nov 02 12:34:56 2018 PDT
|
|
|
|
2 | Fri Nov 02 12:34:56 2018 PDT
|
|
|
|
3 | Fri Nov 02 12:34:56 2018 PDT
|
|
|
|
4 | Fri Nov 02 12:34:56 2018 PDT
|
|
|
|
5 | Fri Nov 02 12:34:56 2018 PDT
|
|
|
|
6 | Fri Nov 02 12:34:56 2018 PDT
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
i | to_timestamp
|
|
|
|
---+--------------------------------
|
|
|
|
1 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
2 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
3 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
4 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
5 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
6 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
i | to_timestamp
|
|
|
|
---+---------------------------------
|
|
|
|
1 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
2 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
3 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
4 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
5 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
6 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
i | to_timestamp
|
|
|
|
---+----------------------------------
|
|
|
|
1 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
2 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
3 | Fri Nov 02 12:34:56.123 2018 PDT
|
|
|
|
4 | Fri Nov 02 12:34:56.123 2018 PDT
|
|
|
|
5 | Fri Nov 02 12:34:56.123 2018 PDT
|
|
|
|
6 | Fri Nov 02 12:34:56.123 2018 PDT
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
i | to_timestamp
|
|
|
|
---+-----------------------------------
|
|
|
|
1 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
2 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
3 | Fri Nov 02 12:34:56.123 2018 PDT
|
|
|
|
4 | Fri Nov 02 12:34:56.1234 2018 PDT
|
|
|
|
5 | Fri Nov 02 12:34:56.1234 2018 PDT
|
|
|
|
6 | Fri Nov 02 12:34:56.1234 2018 PDT
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
i | to_timestamp
|
|
|
|
---+------------------------------------
|
|
|
|
1 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
2 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
3 | Fri Nov 02 12:34:56.123 2018 PDT
|
|
|
|
4 | Fri Nov 02 12:34:56.1235 2018 PDT
|
|
|
|
5 | Fri Nov 02 12:34:56.12345 2018 PDT
|
|
|
|
6 | Fri Nov 02 12:34:56.12345 2018 PDT
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
i | to_timestamp
|
|
|
|
---+-------------------------------------
|
|
|
|
1 | Fri Nov 02 12:34:56.1 2018 PDT
|
|
|
|
2 | Fri Nov 02 12:34:56.12 2018 PDT
|
|
|
|
3 | Fri Nov 02 12:34:56.123 2018 PDT
|
|
|
|
4 | Fri Nov 02 12:34:56.1235 2018 PDT
|
|
|
|
5 | Fri Nov 02 12:34:56.12346 2018 PDT
|
|
|
|
6 | Fri Nov 02 12:34:56.123456 2018 PDT
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
|
|
|
|
ERROR: date/time field value out of range: "2018-11-02 12:34:56.123456789"
|
2020-01-23 22:15:32 +01:00
|
|
|
SELECT to_date('1 4 1902', 'Q MM YYYY'); -- Q is ignored
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
04-01-1902
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('3 4 21 01', 'W MM CC YY');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
04-15-2001
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2458872', 'J');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
01-23-2020
|
|
|
|
(1 row)
|
|
|
|
|
2020-09-30 21:40:23 +02:00
|
|
|
--
|
|
|
|
-- Check handling of BC dates
|
|
|
|
--
|
|
|
|
SELECT to_date('44-02-01 BC','YYYY-MM-DD BC');
|
|
|
|
to_date
|
|
|
|
---------------
|
|
|
|
02-01-0044 BC
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('-44-02-01','YYYY-MM-DD');
|
|
|
|
to_date
|
|
|
|
---------------
|
|
|
|
02-01-0044 BC
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('-44-02-01 BC','YYYY-MM-DD BC');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
02-01-0044
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
|
|
|
|
to_timestamp
|
|
|
|
---------------------------------
|
|
|
|
Fri Feb 01 11:12:13 0044 PST BC
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('-44-02-01 11:12:13','YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
---------------------------------
|
|
|
|
Fri Feb 01 11:12:13 0044 PST BC
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('-44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Mon Feb 01 11:12:13 0044 PST
|
|
|
|
(1 row)
|
|
|
|
|
2014-01-20 19:45:51 +01:00
|
|
|
--
|
|
|
|
-- Check handling of multiple spaces in format and/or input
|
|
|
|
--
|
|
|
|
SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
Sun Dec 18 23:38:15 2011 PST
|
2014-01-20 19:45:51 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 23:38:15 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 23:38:15 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 23:38:15 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sun Dec 18 23:38:15 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
Sun Dec 18 23:38:15 2011 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2000+ JUN', 'YYYY/MON');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jun 01 00:00:00 2000 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp(' 2000 +JUN', 'YYYY/MON');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jun 01 00:00:00 2000 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp(' 2000 +JUN', 'YYYY//MON');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jun 01 00:00:00 2000 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2000 +JUN', 'YYYY//MON');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jun 01 00:00:00 2000 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2000 + JUN', 'YYYY MON');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jun 01 00:00:00 2000 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2000 ++ JUN', 'YYYY MON');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jun 01 00:00:00 2000 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
|
Clean up formatting.c's logic for matching constant strings.
seq_search(), which is used to match input substrings to constants
such as month and day names, had a lot of bizarre and unnecessary
behaviors. It was mostly possible to avert our eyes from that before,
but we don't want to duplicate those behaviors in the upcoming patch
to allow recognition of non-English month and day names. So it's time
to clean this up. In particular:
* seq_search scribbled on the input string, which is a pretty dangerous
thing to do, especially in the badly underdocumented way it was done here.
Fortunately the input string is a temporary copy, but that was being made
three subroutine levels away, making it something easy to break
accidentally. The behavior is externally visible nonetheless, in the form
of odd case-folding in error reports about unrecognized month/day names.
The scribbling is evidently being done to save a few calls to pg_tolower,
but that's such a cheap function (at least for ASCII data) that it's
pretty pointless to worry about. In HEAD I switched it to be
pg_ascii_tolower to ensure it is cheap in all cases; but there are corner
cases in Turkish where this'd change behavior, so leave it as pg_tolower
in the back branches.
* seq_search insisted on knowing the case form (all-upper, all-lower,
or initcap) of the constant strings, so that it didn't have to case-fold
them to perform case-insensitive comparisons. This likewise seems like
excessive micro-optimization, given that pg_tolower is certainly very
cheap for ASCII data. It seems unsafe to assume that we know the case
form that will come out of pg_locale.c for localized month/day names, so
it's better just to define the comparison rule as "downcase all strings
before comparing". (The choice between downcasing and upcasing is
arbitrary so far as English is concerned, but it might not be in other
locales, so follow citext's lead here.)
* seq_search also had a parameter that'd cause it to report a match
after a maximum number of characters, even if the constant string were
longer than that. This was not actually used because no caller passed
a value small enough to cut off a comparison. Replicating that behavior
for localized month/day names seems expensive as well as useless, so
let's get rid of that too.
* from_char_seq_search used the maximum-length parameter to truncate
the input string in error reports about not finding a matching name.
This leads to rather confusing reports in many cases. Worse, it is
outright dangerous if the input string isn't all-ASCII, because we
risk truncating the string in the middle of a multibyte character.
That'd lead either to delivering an illegible error message to the
client, or to encoding-conversion failures that obscure the actual
data problem. Get rid of that in favor of truncating at whitespace
if any (a suggestion due to Alvaro Herrera).
In addition to fixing these things, I const-ified the input string
pointers of DCH_from_char and its subroutines, to make sure there
aren't any other scribbling-on-input problems.
The risk of generating a badly-encoded error message seems like
enough of a bug to justify back-patching, so patch all supported
branches.
Discussion: https://postgr.es/m/29432.1579731087@sss.pgh.pa.us
2020-01-23 19:42:09 +01:00
|
|
|
ERROR: invalid value "+" for "MON"
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
DETAIL: The given value did not match any of the allowed values for this field.
|
|
|
|
SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Thu Jun 01 00:00:00 2000 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2000 -10', 'YYYY TZH');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Sat Jan 01 02:00:00 2000 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2000 -10', 'YYYY TZH');
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Fri Dec 31 06:00:00 1999 PST
|
2014-01-20 19:45:51 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011 12 18', 'YYYY MM DD');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-18-2011
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011 12 18', 'YYYY MM DD');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-18-2011
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011 12 18', 'YYYY MM DD');
|
|
|
|
to_date
|
|
|
|
------------
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
12-18-2011
|
2014-01-20 19:45:51 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011 12 18', 'YYYY MM DD');
|
|
|
|
to_date
|
|
|
|
------------
|
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oracle
compatibility, and became very popular among PostgreSQL users. However, some
behavior of to_timestamp()/to_date() functions are both incompatible with Oracle
and confusing for our users. This behavior is related to handling of spaces and
separators in non FX (fixed format) mode. This commit reworks this behavior
making less confusing, better documented and more compatible with Oracle.
Nevertheless, there are still following incompatibilities with Oracle.
1) We don't insist that there are no format string patterns unmatched to
input string.
2) In FX mode we don't insist space and separators in format string to exactly
match input string.
3) When format string patterns are divided by mix of spaces and separators, we
don't distinguish them, while Oracle takes into account only last group of
spaces/separators.
Discussion: https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.com
Author: Artur Zakirov, Alexander Korotkov, Liudmila Mantrova
Review: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston
2018-09-09 20:19:51 +02:00
|
|
|
12-18-2011
|
2014-01-20 19:45:51 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011 12 18', 'YYYY MM DD');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-18-2011
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011 12 18', 'YYYY MM DD');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-18-2011
|
|
|
|
(1 row)
|
|
|
|
|
2018-09-20 14:48:04 +02:00
|
|
|
SELECT to_date('2011 12 18', 'YYYYxMMxDD');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-18-2011
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011x 12x 18', 'YYYYxMMxDD');
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-18-2011
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
|
|
|
|
ERROR: invalid value "x1" for "MM"
|
|
|
|
DETAIL: Value must be an integer.
|
2008-09-11 19:32:34 +02:00
|
|
|
--
|
Make to_timestamp() and to_date() range-check fields of their input.
Historically, something like to_date('2009-06-40','YYYY-MM-DD') would
return '2009-07-10' because there was no prohibition on out-of-range
month or day numbers. This has been widely panned, and it also turns
out that Oracle throws an error in such cases. Since these functions
are nominally Oracle-compatibility features, let's change that.
There's no particular restriction on year (modulo the fact that the
scanner may not believe that more than 4 digits are year digits,
a matter to be addressed separately if at all). But we now check month,
day, hour, minute, second, and fractional-second fields, as well as
day-of-year and second-of-day fields if those are used.
Currently, no checks are made on ISO-8601-style week numbers or day
numbers; it's not very clear what the appropriate rules would be there,
and they're probably so little used that it's not worth sweating over.
Artur Zakirov, reviewed by Amul Sul, further adjustments by me
Discussion: <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com>
See-Also: <57786490.9010201@wars-nicht.de>
2016-09-28 20:36:04 +02:00
|
|
|
-- Check errors for some incorrect usages of to_timestamp() and to_date()
|
2008-09-11 19:32:34 +02:00
|
|
|
--
|
|
|
|
-- Mixture of date conventions (ISO week and Gregorian):
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('2005527', 'YYYYIWID');
|
2008-09-11 19:32:34 +02:00
|
|
|
ERROR: invalid combination of date conventions
|
|
|
|
HINT: Do not mix Gregorian and ISO week date conventions in a formatting template.
|
|
|
|
-- Insufficient characters in the source string:
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('19971', 'YYYYMMDD');
|
2008-09-11 19:32:34 +02:00
|
|
|
ERROR: source string too short for "MM" formatting field
|
|
|
|
DETAIL: Field requires 2 characters, but only 1 remain.
|
|
|
|
HINT: If your source string is not fixed-width, try using the "FM" modifier.
|
|
|
|
-- Insufficient digit characters for a single node:
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('19971)24', 'YYYYMMDD');
|
2009-02-07 15:16:46 +01:00
|
|
|
ERROR: invalid value "1)" for "MM"
|
2008-09-11 19:32:34 +02:00
|
|
|
DETAIL: Field requires 2 characters, but only 1 could be parsed.
|
|
|
|
HINT: If your source string is not fixed-width, try using the "FM" modifier.
|
2020-01-23 22:15:32 +01:00
|
|
|
-- We don't accept full-length day or month names if short form is specified:
|
|
|
|
SELECT to_timestamp('Friday 1-January-1999', 'DY DD MON YYYY');
|
|
|
|
ERROR: invalid value "da" for "DD"
|
|
|
|
DETAIL: Value must be an integer.
|
|
|
|
SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
|
|
|
|
ERROR: invalid value "uary" for "YYYY"
|
|
|
|
DETAIL: Value must be an integer.
|
|
|
|
SELECT to_timestamp('Fri 1-Jan-1999', 'DY DD MON YYYY'); -- ok
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Fri Jan 01 00:00:00 1999 PST
|
|
|
|
(1 row)
|
|
|
|
|
2008-09-11 19:32:34 +02:00
|
|
|
-- Value clobbering:
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('1997-11-Jan-16', 'YYYY-MM-Mon-DD');
|
2008-09-11 19:32:34 +02:00
|
|
|
ERROR: conflicting values for "Mon" field in formatting string
|
|
|
|
DETAIL: This value contradicts a previous setting for the same field type.
|
|
|
|
-- Non-numeric input:
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('199711xy', 'YYYYMMDD');
|
2009-02-07 15:16:46 +01:00
|
|
|
ERROR: invalid value "xy" for "DD"
|
2008-09-11 19:32:34 +02:00
|
|
|
DETAIL: Value must be an integer.
|
|
|
|
-- Input that doesn't fit in an int:
|
2009-06-22 19:54:30 +02:00
|
|
|
SELECT to_timestamp('10000000000', 'FMYYYY');
|
2008-09-11 19:32:34 +02:00
|
|
|
ERROR: value for "YYYY" in source string is out of range
|
|
|
|
DETAIL: Value must be in the range -2147483648 to 2147483647.
|
Make to_timestamp() and to_date() range-check fields of their input.
Historically, something like to_date('2009-06-40','YYYY-MM-DD') would
return '2009-07-10' because there was no prohibition on out-of-range
month or day numbers. This has been widely panned, and it also turns
out that Oracle throws an error in such cases. Since these functions
are nominally Oracle-compatibility features, let's change that.
There's no particular restriction on year (modulo the fact that the
scanner may not believe that more than 4 digits are year digits,
a matter to be addressed separately if at all). But we now check month,
day, hour, minute, second, and fractional-second fields, as well as
day-of-year and second-of-day fields if those are used.
Currently, no checks are made on ISO-8601-style week numbers or day
numbers; it's not very clear what the appropriate rules would be there,
and they're probably so little used that it's not worth sweating over.
Artur Zakirov, reviewed by Amul Sul, further adjustments by me
Discussion: <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com>
See-Also: <57786490.9010201@wars-nicht.de>
2016-09-28 20:36:04 +02:00
|
|
|
-- Out-of-range and not-quite-out-of-range fields:
|
|
|
|
SELECT to_timestamp('2016-06-13 25:00:00', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
ERROR: date/time field value out of range: "2016-06-13 25:00:00"
|
|
|
|
SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
ERROR: date/time field value out of range: "2016-06-13 15:60:00"
|
|
|
|
SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
ERROR: date/time field value out of range: "2016-06-13 15:50:60"
|
|
|
|
SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Mon Jun 13 15:50:55 2016 PDT
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
|
|
|
|
ERROR: hour "15" is invalid for the 12-hour clock
|
|
|
|
HINT: Use the 24-hour clock, or give an hour between 1 and 12.
|
|
|
|
SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
ERROR: date/time field value out of range: "2016-13-01 15:50:55"
|
|
|
|
SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
ERROR: date/time field value out of range: "2016-02-30 15:50:55"
|
|
|
|
SELECT to_timestamp('2016-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Mon Feb 29 15:50:55 2016 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
|
|
|
|
ERROR: date/time field value out of range: "2015-02-29 15:50:55"
|
|
|
|
SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSS'); -- ok
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Wed Feb 11 23:53:20 2015 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
|
|
|
|
ERROR: date/time field value out of range: "2015-02-11 86400"
|
2019-09-16 20:02:32 +02:00
|
|
|
SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSSS'); -- ok
|
|
|
|
to_timestamp
|
|
|
|
------------------------------
|
|
|
|
Wed Feb 11 23:53:20 2015 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
|
|
|
|
ERROR: date/time field value out of range: "2015-02-11 86400"
|
Make to_timestamp() and to_date() range-check fields of their input.
Historically, something like to_date('2009-06-40','YYYY-MM-DD') would
return '2009-07-10' because there was no prohibition on out-of-range
month or day numbers. This has been widely panned, and it also turns
out that Oracle throws an error in such cases. Since these functions
are nominally Oracle-compatibility features, let's change that.
There's no particular restriction on year (modulo the fact that the
scanner may not believe that more than 4 digits are year digits,
a matter to be addressed separately if at all). But we now check month,
day, hour, minute, second, and fractional-second fields, as well as
day-of-year and second-of-day fields if those are used.
Currently, no checks are made on ISO-8601-style week numbers or day
numbers; it's not very clear what the appropriate rules would be there,
and they're probably so little used that it's not worth sweating over.
Artur Zakirov, reviewed by Amul Sul, further adjustments by me
Discussion: <1873520224.1784572.1465833145330.JavaMail.yahoo@mail.yahoo.com>
See-Also: <57786490.9010201@wars-nicht.de>
2016-09-28 20:36:04 +02:00
|
|
|
SELECT to_date('2016-13-10', 'YYYY-MM-DD');
|
|
|
|
ERROR: date/time field value out of range: "2016-13-10"
|
|
|
|
SELECT to_date('2016-02-30', 'YYYY-MM-DD');
|
|
|
|
ERROR: date/time field value out of range: "2016-02-30"
|
|
|
|
SELECT to_date('2016-02-29', 'YYYY-MM-DD'); -- ok
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
02-29-2016
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2015-02-29', 'YYYY-MM-DD');
|
|
|
|
ERROR: date/time field value out of range: "2015-02-29"
|
|
|
|
SELECT to_date('2015 365', 'YYYY DDD'); -- ok
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-31-2015
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2015 366', 'YYYY DDD');
|
|
|
|
ERROR: date/time field value out of range: "2015 366"
|
|
|
|
SELECT to_date('2016 365', 'YYYY DDD'); -- ok
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-30-2016
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2016 366', 'YYYY DDD'); -- ok
|
|
|
|
to_date
|
|
|
|
------------
|
|
|
|
12-31-2016
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_date('2016 367', 'YYYY DDD');
|
|
|
|
ERROR: date/time field value out of range: "2016 367"
|
2020-09-30 21:40:23 +02:00
|
|
|
SELECT to_date('0000-02-01','YYYY-MM-DD'); -- allowed, though it shouldn't be
|
|
|
|
to_date
|
|
|
|
---------------
|
|
|
|
02-01-0001 BC
|
|
|
|
(1 row)
|
|
|
|
|
Support TZ and OF format codes in to_timestamp().
Formerly, these were only supported in to_char(), but there seems
little reason for that restriction. We should at least have enough
support to permit round-tripping the output of to_char().
In that spirit, TZ accepts either zone abbreviations or numeric
(HH or HH:MM) offsets, which are the cases that to_char() can output.
In an ideal world we'd make it take full zone names too, but
that seems like it'd introduce an unreasonable amount of ambiguity,
since the rules for POSIX-spec zone names are so lax.
OF is a subset of this, accepting only HH or HH:MM.
One small benefit of this improvement is that we can simplify
jsonpath's executeDateTimeMethod function, which no longer needs
to consider the HH and HH:MM cases separately. Moreover, letting
it accept zone abbreviations means it will accept "Z" to mean UTC,
which is emitted by JSON.stringify() for example.
Patch by me, reviewed by Aleksander Alekseev and Daniel Gustafsson
Discussion: https://postgr.es/m/1681086.1686673242@sss.pgh.pa.us
2024-01-25 23:47:08 +01:00
|
|
|
-- to_char's TZ format code produces zone abbrev if known
|
|
|
|
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS TZ');
|
|
|
|
to_char
|
|
|
|
-------------------------
|
|
|
|
2012-12-12 12:00:00 PST
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS tz');
|
|
|
|
to_char
|
|
|
|
-------------------------
|
|
|
|
2012-12-12 12:00:00 pst
|
|
|
|
(1 row)
|
|
|
|
|
Fix some odd behaviors when using a SQL-style simple GMT offset timezone.
Formerly, when using a SQL-spec timezone setting with a fixed GMT offset
(called a "brute force" timezone in the code), the session_timezone
variable was not updated to match the nominal timezone; rather, all code
was expected to ignore session_timezone if HasCTZSet was true. This is
of course obviously fragile, though a search of the code finds only
timeofday() failing to honor the rule. A bigger problem was that
DetermineTimeZoneOffset() supposed that if its pg_tz parameter was
pointer-equal to session_timezone, then HasCTZSet should override the
parameter. This would cause datetime input containing an explicit zone
name to be treated as referencing the brute-force zone instead, if the
zone name happened to match the session timezone that had prevailed
before installing the brute-force zone setting (as reported in bug #8572).
The same malady could affect AT TIME ZONE operators.
To fix, set up session_timezone so that it matches the brute-force zone
specification, which we can do using the POSIX timezone definition syntax
"<abbrev>offset", and get rid of the bogus lookaside check in
DetermineTimeZoneOffset(). Aside from fixing the erroneous behavior in
datetime parsing and AT TIME ZONE, this will cause the timeofday() function
to print its result in the user-requested time zone rather than some
previously-set zone. It might also affect results in third-party
extensions, if there are any that make use of session_timezone without
considering HasCTZSet, but in all cases the new behavior should be saner
than before.
Back-patch to all supported branches.
2013-11-01 17:13:18 +01:00
|
|
|
--
|
|
|
|
-- Check behavior with SQL-style fixed-GMT-offset time zone (cf bug #8572)
|
|
|
|
--
|
|
|
|
SET TIME ZONE 'America/New_York';
|
|
|
|
SET TIME ZONE '-1.5';
|
|
|
|
SHOW TIME ZONE;
|
2013-11-01 18:57:31 +01:00
|
|
|
TimeZone
|
|
|
|
----------------
|
|
|
|
<-01:30>+01:30
|
Fix some odd behaviors when using a SQL-style simple GMT offset timezone.
Formerly, when using a SQL-spec timezone setting with a fixed GMT offset
(called a "brute force" timezone in the code), the session_timezone
variable was not updated to match the nominal timezone; rather, all code
was expected to ignore session_timezone if HasCTZSet was true. This is
of course obviously fragile, though a search of the code finds only
timeofday() failing to honor the rule. A bigger problem was that
DetermineTimeZoneOffset() supposed that if its pg_tz parameter was
pointer-equal to session_timezone, then HasCTZSet should override the
parameter. This would cause datetime input containing an explicit zone
name to be treated as referencing the brute-force zone instead, if the
zone name happened to match the session timezone that had prevailed
before installing the brute-force zone setting (as reported in bug #8572).
The same malady could affect AT TIME ZONE operators.
To fix, set up session_timezone so that it matches the brute-force zone
specification, which we can do using the POSIX timezone definition syntax
"<abbrev>offset", and get rid of the bogus lookaside check in
DetermineTimeZoneOffset(). Aside from fixing the erroneous behavior in
datetime parsing and AT TIME ZONE, this will cause the timeofday() function
to print its result in the user-requested time zone rather than some
previously-set zone. It might also affect results in third-party
extensions, if there are any that make use of session_timezone without
considering HasCTZSet, but in all cases the new behavior should be saner
than before.
Back-patch to all supported branches.
2013-11-01 17:13:18 +01:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '2012-12-12 12:00'::timestamptz;
|
|
|
|
timestamptz
|
|
|
|
---------------------------------
|
|
|
|
Wed Dec 12 12:00:00 2012 -01:30
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
|
|
|
|
timestamptz
|
|
|
|
---------------------------------
|
|
|
|
Wed Dec 12 15:30:00 2012 -01:30
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS TZ');
|
2013-11-01 17:51:27 +01:00
|
|
|
to_char
|
|
|
|
----------------------------
|
|
|
|
2012-12-12 12:00:00 -01:30
|
Fix some odd behaviors when using a SQL-style simple GMT offset timezone.
Formerly, when using a SQL-spec timezone setting with a fixed GMT offset
(called a "brute force" timezone in the code), the session_timezone
variable was not updated to match the nominal timezone; rather, all code
was expected to ignore session_timezone if HasCTZSet was true. This is
of course obviously fragile, though a search of the code finds only
timeofday() failing to honor the rule. A bigger problem was that
DetermineTimeZoneOffset() supposed that if its pg_tz parameter was
pointer-equal to session_timezone, then HasCTZSet should override the
parameter. This would cause datetime input containing an explicit zone
name to be treated as referencing the brute-force zone instead, if the
zone name happened to match the session timezone that had prevailed
before installing the brute-force zone setting (as reported in bug #8572).
The same malady could affect AT TIME ZONE operators.
To fix, set up session_timezone so that it matches the brute-force zone
specification, which we can do using the POSIX timezone definition syntax
"<abbrev>offset", and get rid of the bogus lookaside check in
DetermineTimeZoneOffset(). Aside from fixing the erroneous behavior in
datetime parsing and AT TIME ZONE, this will cause the timeofday() function
to print its result in the user-requested time zone rather than some
previously-set zone. It might also affect results in third-party
extensions, if there are any that make use of session_timezone without
considering HasCTZSet, but in all cases the new behavior should be saner
than before.
Back-patch to all supported branches.
2013-11-01 17:13:18 +01:00
|
|
|
(1 row)
|
|
|
|
|
2019-09-16 20:02:32 +02:00
|
|
|
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSS');
|
|
|
|
to_char
|
|
|
|
------------------
|
|
|
|
2012-12-12 43200
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSSS');
|
|
|
|
to_char
|
|
|
|
------------------
|
|
|
|
2012-12-12 43200
|
|
|
|
(1 row)
|
|
|
|
|
Support TZ and OF format codes in to_timestamp().
Formerly, these were only supported in to_char(), but there seems
little reason for that restriction. We should at least have enough
support to permit round-tripping the output of to_char().
In that spirit, TZ accepts either zone abbreviations or numeric
(HH or HH:MM) offsets, which are the cases that to_char() can output.
In an ideal world we'd make it take full zone names too, but
that seems like it'd introduce an unreasonable amount of ambiguity,
since the rules for POSIX-spec zone names are so lax.
OF is a subset of this, accepting only HH or HH:MM.
One small benefit of this improvement is that we can simplify
jsonpath's executeDateTimeMethod function, which no longer needs
to consider the HH and HH:MM cases separately. Moreover, letting
it accept zone abbreviations means it will accept "Z" to mean UTC,
which is emitted by JSON.stringify() for example.
Patch by me, reviewed by Aleksander Alekseev and Daniel Gustafsson
Discussion: https://postgr.es/m/1681086.1686673242@sss.pgh.pa.us
2024-01-25 23:47:08 +01:00
|
|
|
SET TIME ZONE '+2';
|
|
|
|
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS TZ');
|
|
|
|
to_char
|
|
|
|
-------------------------
|
|
|
|
2012-12-12 12:00:00 +02
|
|
|
|
(1 row)
|
|
|
|
|
Fix some odd behaviors when using a SQL-style simple GMT offset timezone.
Formerly, when using a SQL-spec timezone setting with a fixed GMT offset
(called a "brute force" timezone in the code), the session_timezone
variable was not updated to match the nominal timezone; rather, all code
was expected to ignore session_timezone if HasCTZSet was true. This is
of course obviously fragile, though a search of the code finds only
timeofday() failing to honor the rule. A bigger problem was that
DetermineTimeZoneOffset() supposed that if its pg_tz parameter was
pointer-equal to session_timezone, then HasCTZSet should override the
parameter. This would cause datetime input containing an explicit zone
name to be treated as referencing the brute-force zone instead, if the
zone name happened to match the session timezone that had prevailed
before installing the brute-force zone setting (as reported in bug #8572).
The same malady could affect AT TIME ZONE operators.
To fix, set up session_timezone so that it matches the brute-force zone
specification, which we can do using the POSIX timezone definition syntax
"<abbrev>offset", and get rid of the bogus lookaside check in
DetermineTimeZoneOffset(). Aside from fixing the erroneous behavior in
datetime parsing and AT TIME ZONE, this will cause the timeofday() function
to print its result in the user-requested time zone rather than some
previously-set zone. It might also affect results in third-party
extensions, if there are any that make use of session_timezone without
considering HasCTZSet, but in all cases the new behavior should be saner
than before.
Back-patch to all supported branches.
2013-11-01 17:13:18 +01:00
|
|
|
RESET TIME ZONE;
|