1997-04-05 13:06:04 +02:00
|
|
|
QUERY: CREATE TABLE ABSTIME_TBL (f1 abstime);
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Jan 14, 1973 03:14:21');
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Mon May 1 00:30:30 1995'::abstime);
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('epoch'::abstime);
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('current'::abstime);
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('infinity'::abstime);
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('-infinity'::abstime);
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('May 10, 1943 23:59:12');
|
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
|
1997-04-27 04:58:38 +02:00
|
|
|
WARN:Bad abstime external representation 'Feb 35, 1946 10:00:00'
|
1997-04-05 13:06:04 +02:00
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
|
1997-04-27 04:58:38 +02:00
|
|
|
WARN:Bad abstime external representation 'Feb 28, 1984 25:08:10'
|
1997-04-05 13:06:04 +02:00
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
|
1997-04-27 04:58:38 +02:00
|
|
|
WARN:Bad abstime external representation 'bad date format'
|
1997-04-05 13:06:04 +02:00
|
|
|
QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
|
1997-04-27 04:58:38 +02:00
|
|
|
QUERY: SELECT '' AS eight, ABSTIME_TBL.*;
|
1997-04-05 13:06:04 +02:00
|
|
|
eight|f1
|
|
|
|
-----+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|Mon May 01 00:30:30 1995 PDT
|
|
|
|
|epoch
|
|
|
|
|current
|
|
|
|
|infinity
|
|
|
|
|-infinity
|
1997-04-27 04:58:38 +02:00
|
|
|
|Mon May 10 23:59:12 1943 PST
|
|
|
|
|invalid
|
1997-04-05 13:06:04 +02:00
|
|
|
(8 rows)
|
|
|
|
|
|
|
|
QUERY: SELECT '' AS six, ABSTIME_TBL.*
|
1997-04-27 04:58:38 +02:00
|
|
|
WHERE ABSTIME_TBL.f1 < 'Jun 30, 2001'::abstime;
|
1997-04-05 13:06:04 +02:00
|
|
|
six|f1
|
|
|
|
---+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
1997-04-27 04:58:38 +02:00
|
|
|
|Mon May 01 00:30:30 1995 PDT
|
1997-04-05 13:06:04 +02:00
|
|
|
|epoch
|
1997-04-27 04:58:38 +02:00
|
|
|
|current
|
1997-04-05 13:06:04 +02:00
|
|
|
|-infinity
|
1997-04-27 04:58:38 +02:00
|
|
|
|Mon May 10 23:59:12 1943 PST
|
1997-04-05 13:06:04 +02:00
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
QUERY: SELECT '' AS six, ABSTIME_TBL.*
|
1997-04-27 04:58:38 +02:00
|
|
|
WHERE ABSTIME_TBL.f1 > '-infinity'::abstime;
|
1997-04-05 13:06:04 +02:00
|
|
|
six|f1
|
|
|
|
---+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|Mon May 01 00:30:30 1995 PDT
|
|
|
|
|epoch
|
|
|
|
|current
|
1997-04-27 04:58:38 +02:00
|
|
|
|infinity
|
|
|
|
|Mon May 10 23:59:12 1943 PST
|
1997-04-05 13:06:04 +02:00
|
|
|
(6 rows)
|
|
|
|
|
1997-04-27 04:58:38 +02:00
|
|
|
QUERY: SELECT '' AS six, ABSTIME_TBL.*
|
|
|
|
WHERE 'May 10, 1943 23:59:12'::abstime <> ABSTIME_TBL.f1;
|
|
|
|
six|f1
|
|
|
|
---+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|Mon May 01 00:30:30 1995 PDT
|
|
|
|
|epoch
|
|
|
|
|current
|
|
|
|
|infinity
|
|
|
|
|-infinity
|
|
|
|
(6 rows)
|
1997-04-05 13:06:04 +02:00
|
|
|
|
1997-04-27 04:58:38 +02:00
|
|
|
QUERY: SELECT '' AS one, ABSTIME_TBL.*
|
|
|
|
WHERE 'current'::abstime = ABSTIME_TBL.f1;
|
|
|
|
one|f1
|
|
|
|
---+-------
|
|
|
|
|current
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
QUERY: SELECT '' AS three, ABSTIME_TBL.*
|
|
|
|
WHERE 'epoch'::abstime >= ABSTIME_TBL.f1;
|
|
|
|
three|f1
|
|
|
|
-----+----------------------------
|
|
|
|
|epoch
|
|
|
|
|-infinity
|
|
|
|
|Mon May 10 23:59:12 1943 PST
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
QUERY: SELECT '' AS four, ABSTIME_TBL.*
|
|
|
|
WHERE ABSTIME_TBL.f1 <= 'Jan 14, 1973 03:14:21'::abstime;
|
|
|
|
four|f1
|
1997-04-05 13:06:04 +02:00
|
|
|
----+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|epoch
|
1997-04-27 04:58:38 +02:00
|
|
|
|-infinity
|
|
|
|
|Mon May 10 23:59:12 1943 PST
|
|
|
|
(4 rows)
|
1997-04-05 13:06:04 +02:00
|
|
|
|
1997-04-27 04:58:38 +02:00
|
|
|
QUERY: SELECT '' AS four, ABSTIME_TBL.*
|
|
|
|
WHERE ABSTIME_TBL.f1 <?>
|
|
|
|
'["Apr 1 1945 00:00:00" "Dec 30 1999 23:00:00"]'::tinterval;
|
|
|
|
four|f1
|
1997-04-05 13:06:04 +02:00
|
|
|
----+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
1997-04-27 04:58:38 +02:00
|
|
|
|Mon May 01 00:30:30 1995 PDT
|
1997-04-05 13:06:04 +02:00
|
|
|
|epoch
|
1997-04-27 04:58:38 +02:00
|
|
|
|current
|
|
|
|
(4 rows)
|
1997-04-05 13:06:04 +02:00
|
|
|
|
1997-04-27 04:58:38 +02:00
|
|
|
QUERY: SELECT '' AS three, ABSTIME_TBL.*
|
|
|
|
WHERE (ABSTIME_TBL.f1 + '@ 3 year'::reltime)
|
1997-04-05 13:06:04 +02:00
|
|
|
< 'Jan 14 14:00:00 1977'::abstime;
|
1997-04-27 04:58:38 +02:00
|
|
|
three|f1
|
|
|
|
-----+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|epoch
|
|
|
|
|Mon May 10 23:59:12 1943 PST
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
QUERY: SELECT '' AS three, ABSTIME_TBL.*
|
|
|
|
WHERE (ABSTIME_TBL.f1 + '@ 3 year ago'::reltime)
|
|
|
|
< 'Jan 14 14:00:00 1971'::abstime;
|
|
|
|
three|f1
|
|
|
|
-----+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|epoch
|
|
|
|
|Mon May 10 23:59:12 1943 PST
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
QUERY: SELECT '' AS three, ABSTIME_TBL.*
|
|
|
|
WHERE (ABSTIME_TBL.f1 - '@ 3 year'::reltime)
|
|
|
|
< 'Jan 14 14:00:00 1971'::abstime;
|
|
|
|
three|f1
|
|
|
|
-----+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|epoch
|
|
|
|
|Mon May 10 23:59:12 1943 PST
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
QUERY: SELECT '' AS three, ABSTIME_TBL.*
|
|
|
|
WHERE (ABSTIME_TBL.f1 - '@ 3 year ago'::reltime)
|
|
|
|
< 'Jan 14 14:00:00 1977'::abstime;
|
|
|
|
three|f1
|
|
|
|
-----+----------------------------
|
|
|
|
|Sun Jan 14 03:14:21 1973 PST
|
|
|
|
|epoch
|
|
|
|
|Mon May 10 23:59:12 1943 PST
|
|
|
|
(3 rows)
|
1997-04-05 13:06:04 +02:00
|
|
|
|
1997-04-27 04:58:38 +02:00
|
|
|
QUERY: SELECT '' AS ten, ABSTIME_TBL.*, RELTIME_TBL.*
|
1997-04-05 13:06:04 +02:00
|
|
|
WHERE (ABSTIME_TBL.f1 + RELTIME_TBL.f1)
|
|
|
|
< 'Jan 14 14:00:00 1971'::abstime;
|
1997-04-27 04:58:38 +02:00
|
|
|
ten|f1 |f1
|
|
|
|
---+----------------------------+----------------
|
|
|
|
|epoch |@ 1 minute
|
|
|
|
|Mon May 10 23:59:12 1943 PST|@ 1 minute
|
|
|
|
|epoch |@ 5 hours
|
|
|
|
|Mon May 10 23:59:12 1943 PST|@ 5 hours
|
|
|
|
|epoch |@ 10 days
|
|
|
|
|Mon May 10 23:59:12 1943 PST|@ 10 days
|
|
|
|
|epoch |@ 3 months
|
|
|
|
|Mon May 10 23:59:12 1943 PST|@ 3 months
|
|
|
|
|epoch |@ 14 seconds ago
|
|
|
|
|Mon May 10 23:59:12 1943 PST|@ 14 seconds ago
|
|
|
|
(10 rows)
|
1997-04-05 13:06:04 +02:00
|
|
|
|