Include a few new tests for datetime/timespan arithmetic.
-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, 1947 23:59:12');
-QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
+--
+-- ABSTIME
+-- testing built-in time type abstime
+-- uses reltime and tinterval
+--
+--
+-- timezones may vary based not only on location but the operating
+-- system. the main correctness issue is that the OS may not get
+-- daylight savings time right for times prior to Unix epoch (jan 1 1970).
+--
+CREATE TABLE ABSTIME_TBL (f1 abstime);
+INSERT INTO ABSTIME_TBL (f1) VALUES ('Jan 14, 1973 03:14:21');
+-- was INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'now'):
+INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'Mon May 1 00:30:30 1995');
+INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'epoch');
+INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'current');
+INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'infinity');
+INSERT INTO ABSTIME_TBL (f1) VALUES (abstime '-infinity');
+INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'May 10, 1947 23:59:12');
+-- what happens if we specify slightly misformatted abstime?
+INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
ERROR: Bad abstime external representation 'Feb 35, 1946 10:00:00'
-QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
+INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
ERROR: Bad abstime external representation 'Feb 28, 1984 25:08:10'
-QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
+-- badly formatted abstimes: these should result in invalid abstimes
+INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
ERROR: Bad abstime external representation 'bad date format'
-QUERY: INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
-QUERY: SELECT '' AS eight, ABSTIME_TBL.*;
-eight|f1
------+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |Mon May 01 00:30:30 1995 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |Sat May 10 23:59:12 1947 PST
- |invalid
+INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
+-- test abstime operators
+SELECT '' AS eight, ABSTIME_TBL.*;
+ eight | f1
+-------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | Mon May 01 00:30:30 1995 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | Sat May 10 23:59:12 1947 PST
+ | invalid
(8 rows)
-QUERY: SELECT '' AS six, ABSTIME_TBL.*
- WHERE ABSTIME_TBL.f1 < 'Jun 30, 2001'::abstime;
-six|f1
----+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |Mon May 01 00:30:30 1995 PDT
- |epoch
- |current
- |-infinity
- |Sat May 10 23:59:12 1947 PST
+SELECT '' AS six, ABSTIME_TBL.*
+ WHERE ABSTIME_TBL.f1 < abstime 'Jun 30, 2001';
+ six | f1
+-----+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | Mon May 01 00:30:30 1995 PDT
+ | epoch
+ | current
+ | -infinity
+ | Sat May 10 23:59:12 1947 PST
(6 rows)
-QUERY: SELECT '' AS six, ABSTIME_TBL.*
- WHERE ABSTIME_TBL.f1 > '-infinity'::abstime;
-six|f1
----+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |Mon May 01 00:30:30 1995 PDT
- |epoch
- |current
- |infinity
- |Sat May 10 23:59:12 1947 PST
+SELECT '' AS six, ABSTIME_TBL.*
+ WHERE ABSTIME_TBL.f1 > abstime '-infinity';
+ six | f1
+-----+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | Mon May 01 00:30:30 1995 PDT
+ | epoch
+ | current
+ | infinity
+ | Sat May 10 23:59:12 1947 PST
(6 rows)
-QUERY: SELECT '' AS six, ABSTIME_TBL.*
- WHERE 'May 10, 1947 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
+SELECT '' AS six, ABSTIME_TBL.*
+ WHERE abstime 'May 10, 1947 23:59:12' <> 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)
-QUERY: SELECT '' AS one, ABSTIME_TBL.*
- WHERE 'current'::abstime = ABSTIME_TBL.f1;
-one|f1
----+-------
- |current
+SELECT '' AS one, ABSTIME_TBL.*
+ WHERE abstime 'current' = ABSTIME_TBL.f1;
+ one | f1
+-----+---------
+ | current
(1 row)
-QUERY: SELECT '' AS three, ABSTIME_TBL.*
- WHERE 'epoch'::abstime >= ABSTIME_TBL.f1;
-three|f1
------+----------------------------
- |epoch
- |-infinity
- |Sat May 10 23:59:12 1947 PST
+SELECT '' AS three, ABSTIME_TBL.*
+ WHERE abstime 'epoch' >= ABSTIME_TBL.f1;
+ three | f1
+-------+------------------------------
+ | epoch
+ | -infinity
+ | Sat May 10 23:59:12 1947 PST
(3 rows)
-QUERY: SELECT '' AS four, ABSTIME_TBL.*
- WHERE ABSTIME_TBL.f1 <= 'Jan 14, 1973 03:14:21'::abstime;
-four|f1
-----+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |epoch
- |-infinity
- |Sat May 10 23:59:12 1947 PST
+SELECT '' AS four, ABSTIME_TBL.*
+ WHERE ABSTIME_TBL.f1 <= abstime 'Jan 14, 1973 03:14:21';
+ four | f1
+------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | epoch
+ | -infinity
+ | Sat May 10 23:59:12 1947 PST
(4 rows)
-QUERY: SELECT '' AS four, ABSTIME_TBL.*
+SELECT '' AS four, ABSTIME_TBL.*
WHERE ABSTIME_TBL.f1 <?>
- '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]'::tinterval;
-four|f1
-----+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |Mon May 01 00:30:30 1995 PDT
- |epoch
- |current
-(4 rows)
+ tinterval '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]';
+ four | f1
+------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | Mon May 01 00:30:30 1995 PDT
+ | epoch
+(3 rows)
-QUERY: SELECT '' AS three, ABSTIME_TBL.*
- WHERE (ABSTIME_TBL.f1 + '@ 3 year'::reltime)
- < 'Jan 14 14:00:00 1977'::abstime;
-three|f1
------+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |epoch
- |Sat May 10 23:59:12 1947 PST
+-- these four queries should return the same answer
+-- the "infinity" and "-infinity" tuples in ABSTIME_TBL cannot be added and
+-- therefore, should not show up in the results.
+SELECT '' AS three, ABSTIME_TBL.*
+ WHERE (ABSTIME_TBL.f1 + reltime '@ 3 year') -- +3 years
+ < abstime 'Jan 14 14:00:00 1977';
+ three | f1
+-------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | epoch
+ | Sat May 10 23:59:12 1947 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
- |Sat May 10 23:59:12 1947 PST
+SELECT '' AS three, ABSTIME_TBL.*
+ WHERE (ABSTIME_TBL.f1 + reltime '@ 3 year ago') -- -3 years
+ < abstime 'Jan 14 14:00:00 1971';
+ three | f1
+-------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | epoch
+ | Sat May 10 23:59:12 1947 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
- |Sat May 10 23:59:12 1947 PST
+SELECT '' AS three, ABSTIME_TBL.*
+ WHERE (ABSTIME_TBL.f1 - reltime '@ 3 year') -- -(+3) years
+ < abstime 'Jan 14 14:00:00 1971';
+ three | f1
+-------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | epoch
+ | Sat May 10 23:59:12 1947 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
- |Sat May 10 23:59:12 1947 PST
+SELECT '' AS three, ABSTIME_TBL.*
+ WHERE (ABSTIME_TBL.f1 - reltime '@ 3 year ago') -- -(-3) years
+ < abstime 'Jan 14 14:00:00 1977';
+ three | f1
+-------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | epoch
+ | Sat May 10 23:59:12 1947 PST
(3 rows)
-QUERY: SELECT '' AS ten, ABSTIME_TBL.f1 AS abstime, RELTIME_TBL.f1 AS reltime
+SELECT '' AS ten, ABSTIME_TBL.f1 AS abstime, RELTIME_TBL.f1 AS reltime
WHERE (ABSTIME_TBL.f1 + RELTIME_TBL.f1)
- < 'Jan 14 14:00:00 1971'::abstime
+ < abstime 'Jan 14 14:00:00 1971'
ORDER BY abstime, reltime;
-ten|abstime |reltime
----+----------------------------+-------------
- |Sat May 10 23:59:12 1947 PST|@ 14 secs ago
- |Sat May 10 23:59:12 1947 PST|@ 1 min
- |Sat May 10 23:59:12 1947 PST|@ 5 hours
- |Sat May 10 23:59:12 1947 PST|@ 10 days
- |Sat May 10 23:59:12 1947 PST|@ 3 mons
- |epoch |@ 14 secs ago
- |epoch |@ 1 min
- |epoch |@ 5 hours
- |epoch |@ 10 days
- |epoch |@ 3 mons
+ ten | abstime | reltime
+-----+------------------------------+---------------
+ | Sat May 10 23:59:12 1947 PST | @ 14 secs ago
+ | Sat May 10 23:59:12 1947 PST | @ 1 min
+ | Sat May 10 23:59:12 1947 PST | @ 5 hours
+ | Sat May 10 23:59:12 1947 PST | @ 10 days
+ | Sat May 10 23:59:12 1947 PST | @ 3 mons
+ | epoch | @ 14 secs ago
+ | epoch | @ 1 min
+ | epoch | @ 5 hours
+ | epoch | @ 10 days
+ | epoch | @ 3 mons
(10 rows)
-QUERY: CREATE TABLE BOX_TBL (f1 box);
-QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(2.0,2.0,0.0,0.0)');
-QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(1.0,1.0,3.0,3.0)');
-QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(2.5, 2.5, 2.5,3.5)');
-QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(3.0, 3.0,3.0,3.0)');
-QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(2.3, 4.5)');
+--
+-- BOX
+--
+--
+-- box logic
+-- o
+-- 3 o--|X
+-- | o|
+-- 2 +-+-+ |
+-- | | | |
+-- 1 | o-+-o
+-- | |
+-- 0 +---+
+--
+-- 0 1 2 3
+--
+-- boxes are specified by two points, given by four floats x1,y1,x2,y2
+CREATE TABLE BOX_TBL (f1 box);
+INSERT INTO BOX_TBL (f1) VALUES ('(2.0,2.0,0.0,0.0)');
+INSERT INTO BOX_TBL (f1) VALUES ('(1.0,1.0,3.0,3.0)');
+-- degenerate cases where the box is a line or a point
+-- note that lines and points boxes all have zero area
+INSERT INTO BOX_TBL (f1) VALUES ('(2.5, 2.5, 2.5,3.5)');
+INSERT INTO BOX_TBL (f1) VALUES ('(3.0, 3.0,3.0,3.0)');
+-- badly formatted box inputs
+INSERT INTO BOX_TBL (f1) VALUES ('(2.3, 4.5)');
ERROR: Bad box external representation '(2.3, 4.5)'
-QUERY: INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad');
+INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad');
ERROR: Bad box external representation 'asdfasdf(ad'
-QUERY: SELECT '' AS four, BOX_TBL.*;
-four|f1
-----+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
+SELECT '' AS four, BOX_TBL.*;
+ four | f1
+------+---------------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (2.5,3.5),(2.5,2.5)
+ | (3,3),(3,3)
(4 rows)
-QUERY: SELECT '' AS four, b.*, box_area(b.f1) as barea
+SELECT '' AS four, b.*, box_area(b.f1) as barea
FROM BOX_TBL b;
-four|f1 |barea
-----+-------------------+-----
- |(2,2),(0,0) | 4
- |(3,3),(1,1) | 4
- |(2.5,3.5),(2.5,2.5)| 0
- |(3,3),(3,3) | 0
+ four | f1 | barea
+------+---------------------+-------
+ | (2,2),(0,0) | 4
+ | (3,3),(1,1) | 4
+ | (2.5,3.5),(2.5,2.5) | 0
+ | (3,3),(3,3) | 0
(4 rows)
-QUERY: SELECT '' AS three, b.f1
- FROM BOX_TBL b
- WHERE b.f1 && '(2.5,2.5,1.0,1.0)'::box;
-three|f1
------+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
+-- overlap
+SELECT '' AS three, b.f1
+ FROM BOX_TBL b
+ WHERE b.f1 && box '(2.5,2.5,1.0,1.0)';
+ three | f1
+-------+---------------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (2.5,3.5),(2.5,2.5)
(3 rows)
-QUERY: SELECT '' AS two, b1.*
+-- left-or-overlap (x only)
+SELECT '' AS two, b1.*
FROM BOX_TBL b1
- WHERE b1.f1 &< '(2.0,2.0,2.5,2.5)'::box;
-two|f1
----+-------------------
- |(2,2),(0,0)
- |(2.5,3.5),(2.5,2.5)
+ WHERE b1.f1 &< box '(2.0,2.0,2.5,2.5)';
+ two | f1
+-----+---------------------
+ | (2,2),(0,0)
+ | (2.5,3.5),(2.5,2.5)
(2 rows)
-QUERY: SELECT '' AS two, b1.*
+-- right-or-overlap (x only)
+SELECT '' AS two, b1.*
FROM BOX_TBL b1
- WHERE b1.f1 &> '(2.0,2.0,2.5,2.5)'::box;
-two|f1
----+-------------------
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
+ WHERE b1.f1 &> box '(2.0,2.0,2.5,2.5)';
+ two | f1
+-----+---------------------
+ | (2.5,3.5),(2.5,2.5)
+ | (3,3),(3,3)
(2 rows)
-QUERY: SELECT '' AS two, b.f1
+-- left of
+SELECT '' AS two, b.f1
FROM BOX_TBL b
- WHERE b.f1 << '(3.0,3.0,5.0,5.0)'::box;
-two|f1
----+-------------------
- |(2,2),(0,0)
- |(2.5,3.5),(2.5,2.5)
+ WHERE b.f1 << box '(3.0,3.0,5.0,5.0)';
+ two | f1
+-----+---------------------
+ | (2,2),(0,0)
+ | (2.5,3.5),(2.5,2.5)
(2 rows)
-QUERY: SELECT '' AS four, b.f1
+-- area <=
+SELECT '' AS four, b.f1
FROM BOX_TBL b
- WHERE b.f1 <= '(3.0,3.0,5.0,5.0)'::box;
-four|f1
-----+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
+ WHERE b.f1 <= box '(3.0,3.0,5.0,5.0)';
+ four | f1
+------+---------------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (2.5,3.5),(2.5,2.5)
+ | (3,3),(3,3)
(4 rows)
-QUERY: SELECT '' AS two, b.f1
+-- area <
+SELECT '' AS two, b.f1
FROM BOX_TBL b
- WHERE b.f1 < '(3.0,3.0,5.0,5.0)'::box;
-two|f1
----+-------------------
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
+ WHERE b.f1 < box '(3.0,3.0,5.0,5.0)';
+ two | f1
+-----+---------------------
+ | (2.5,3.5),(2.5,2.5)
+ | (3,3),(3,3)
(2 rows)
-QUERY: SELECT '' AS two, b.f1
+-- area =
+SELECT '' AS two, b.f1
FROM BOX_TBL b
- WHERE b.f1 = '(3.0,3.0,5.0,5.0)'::box;
-two|f1
----+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
+ WHERE b.f1 = box '(3.0,3.0,5.0,5.0)';
+ two | f1
+-----+-------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
(2 rows)
-QUERY: SELECT '' AS two, b.f1
- FROM BOX_TBL b
- WHERE b.f1 > '(3.5,3.0,4.5,3.0)'::box;
-two|f1
----+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
+-- area >
+SELECT '' AS two, b.f1
+ FROM BOX_TBL b -- zero area
+ WHERE b.f1 > box '(3.5,3.0,4.5,3.0)';
+ two | f1
+-----+-------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
(2 rows)
-QUERY: SELECT '' AS four, b.f1
- FROM BOX_TBL b
- WHERE b.f1 >= '(3.5,3.0,4.5,3.0)'::box;
-four|f1
-----+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
+-- area >=
+SELECT '' AS four, b.f1
+ FROM BOX_TBL b -- zero area
+ WHERE b.f1 >= box '(3.5,3.0,4.5,3.0)';
+ four | f1
+------+---------------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (2.5,3.5),(2.5,2.5)
+ | (3,3),(3,3)
(4 rows)
-QUERY: SELECT '' AS two, b.f1
+-- right of
+SELECT '' AS two, b.f1
FROM BOX_TBL b
- WHERE '(3.0,3.0,5.0,5.0)'::box >> b.f1;
-two|f1
----+-------------------
- |(2,2),(0,0)
- |(2.5,3.5),(2.5,2.5)
+ WHERE box '(3.0,3.0,5.0,5.0)' >> b.f1;
+ two | f1
+-----+---------------------
+ | (2,2),(0,0)
+ | (2.5,3.5),(2.5,2.5)
(2 rows)
-QUERY: SELECT '' AS three, b.f1
+-- contained in
+SELECT '' AS three, b.f1
FROM BOX_TBL b
- WHERE b.f1 @ '(0,0,3,3)'::box;
-three|f1
------+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(3,3),(3,3)
+ WHERE b.f1 @ box '(0,0,3,3)';
+ three | f1
+-------+-------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (3,3),(3,3)
(3 rows)
-QUERY: SELECT '' AS three, b.f1
+-- contains
+SELECT '' AS three, b.f1
FROM BOX_TBL b
- WHERE '(0,0,3,3)'::box ~ b.f1;
-three|f1
------+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(3,3),(3,3)
+ WHERE box '(0,0,3,3)' ~ b.f1;
+ three | f1
+-------+-------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (3,3),(3,3)
(3 rows)
-QUERY: SELECT '' AS one, b.f1
+-- box equality
+SELECT '' AS one, b.f1
FROM BOX_TBL b
- WHERE '(1,1,3,3)'::box ~= b.f1;
-one|f1
----+-----------
- |(3,3),(1,1)
+ WHERE box '(1,1,3,3)' ~= b.f1;
+ one | f1
+-----+-------------
+ | (3,3),(1,1)
(1 row)
-QUERY: SELECT '' AS four, @@(b1.f1) AS p
+-- center of box, left unary operator
+SELECT '' AS four, @@(b1.f1) AS p
FROM BOX_TBL b1;
-four|p
-----+-------
- |(1,1)
- |(2,2)
- |(2.5,3)
- |(3,3)
+ four | p
+------+---------
+ | (1,1)
+ | (2,2)
+ | (2.5,3)
+ | (3,3)
(4 rows)
-QUERY: SELECT '' AS one, b1.*, b2.*
- FROM BOX_TBL b1, BOX_TBL b2
+-- wholly-contained
+SELECT '' AS one, b1.*, b2.*
+ FROM BOX_TBL b1, BOX_TBL b2
WHERE b1.f1 ~ b2.f1 and not b1.f1 ~= b2.f1;
-one|f1 |f1
----+-----------+-----------
- |(3,3),(1,1)|(3,3),(3,3)
+ one | f1 | f1
+-----+-------------+-------------
+ | (3,3),(1,1) | (3,3),(3,3)
(1 row)
-QUERY: SELECT '' AS four, height(f1), width(f1) FROM BOX_TBL;
-four|height|width
-----+------+-----
- | 2| 2
- | 2| 2
- | 1| 0
- | 0| 0
+SELECT '' AS four, height(f1), width(f1) FROM BOX_TBL;
+ four | height | width
+------+--------+-------
+ | 2 | 2
+ | 2 | 2
+ | 1 | 0
+ | 0 | 0
(4 rows)
-QUERY: CREATE TABLE CIRCLE_TBL (f1 circle);
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('<(0,0),3>');
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('1,3,5');
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)');
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('<(100,0),100>');
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('<(-100,0),-100>');
+--
+-- CIRCLE
+--
+CREATE TABLE CIRCLE_TBL (f1 circle);
+INSERT INTO CIRCLE_TBL VALUES ('<(0,0),3>');
+INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
+INSERT INTO CIRCLE_TBL VALUES ('1,3,5');
+INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)');
+INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
+INSERT INTO CIRCLE_TBL VALUES ('<(100,0),100>');
+-- bad values
+INSERT INTO CIRCLE_TBL VALUES ('<(-100,0),-100>');
ERROR: Bad circle external representation '<(-100,0),-100>'
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('1abc,3,5');
+INSERT INTO CIRCLE_TBL VALUES ('1abc,3,5');
ERROR: Bad circle external representation '1abc,3,5'
-QUERY: INSERT INTO CIRCLE_TBL VALUES ('(3,(1,2),3)');
+INSERT INTO CIRCLE_TBL VALUES ('(3,(1,2),3)');
ERROR: Bad circle external representation '(3,(1,2),3)'
-QUERY: SELECT * FROM CIRCLE_TBL;
-f1
---------------
-<(0,0),3>
-<(1,2),100>
-<(1,3),5>
-<(1,2),3>
-<(100,200),10>
-<(100,0),100>
+SELECT * FROM CIRCLE_TBL;
+ f1
+----------------
+ <(0,0),3>
+ <(1,2),100>
+ <(1,3),5>
+ <(1,2),3>
+ <(100,200),10>
+ <(100,0),100>
(6 rows)
-QUERY: SELECT '' AS six, center(f1) AS center
+SELECT '' AS six, center(f1) AS center
FROM CIRCLE_TBL;
-six|center
----+---------
- |(0,0)
- |(1,2)
- |(1,3)
- |(1,2)
- |(100,200)
- |(100,0)
+ six | center
+-----+-----------
+ | (0,0)
+ | (1,2)
+ | (1,3)
+ | (1,2)
+ | (100,200)
+ | (100,0)
(6 rows)
-QUERY: SELECT '' AS six, radius(f1) AS radius
+SELECT '' AS six, radius(f1) AS radius
FROM CIRCLE_TBL;
-six|radius
----+------
- | 3
- | 100
- | 5
- | 3
- | 10
- | 100
+ six | radius
+-----+--------
+ | 3
+ | 100
+ | 5
+ | 3
+ | 10
+ | 100
(6 rows)
-QUERY: SELECT '' AS six, diameter(f1) AS diameter
+SELECT '' AS six, diameter(f1) AS diameter
FROM CIRCLE_TBL;
-six|diameter
----+--------
- | 6
- | 200
- | 10
- | 6
- | 20
- | 200
+ six | diameter
+-----+----------
+ | 6
+ | 200
+ | 10
+ | 6
+ | 20
+ | 200
(6 rows)
-QUERY: SELECT '' AS two, f1 FROM CIRCLE_TBL WHERE radius(f1) < 5;
-two|f1
----+---------
- |<(0,0),3>
- |<(1,2),3>
+SELECT '' AS two, f1 FROM CIRCLE_TBL WHERE radius(f1) < 5;
+ two | f1
+-----+-----------
+ | <(0,0),3>
+ | <(1,2),3>
(2 rows)
-QUERY: SELECT '' AS four, f1 FROM CIRCLE_TBL WHERE diameter(f1) >= 10;
-four|f1
-----+--------------
- |<(1,2),100>
- |<(1,3),5>
- |<(100,200),10>
- |<(100,0),100>
+SELECT '' AS four, f1 FROM CIRCLE_TBL WHERE diameter(f1) >= 10;
+ four | f1
+------+----------------
+ | <(1,2),100>
+ | <(1,3),5>
+ | <(100,200),10>
+ | <(100,0),100>
(4 rows)
-QUERY: SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance
+SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance
FROM CIRCLE_TBL c1, CIRCLE_TBL c2
WHERE (c1.f1 < c2.f1) AND ((c1.f1 <-> c2.f1) > 0)
ORDER BY distance, one, two;
-five|one |two | distance
-----+--------------+--------------+----------------
- |<(100,200),10>|<(100,0),100> | 90
- |<(100,200),10>|<(1,2),100> |111.370729772479
- |<(1,3),5> |<(100,200),10>|205.476756144497
- |<(1,2),3> |<(100,200),10>|208.370729772479
- |<(0,0),3> |<(100,200),10>|210.606797749979
+ five | one | two | distance
+------+----------------+----------------+------------------
+ | <(100,200),10> | <(100,0),100> | 90
+ | <(100,200),10> | <(1,2),100> | 111.370729772479
+ | <(1,3),5> | <(100,200),10> | 205.476756144497
+ | <(1,2),3> | <(100,200),10> | 208.370729772479
+ | <(0,0),3> | <(100,200),10> | 210.606797749979
(5 rows)
-QUERY: SELECT 'trailing' AS first;
-first
---------
-trailing
+--
+-- COMMENTS
+--
+SELECT 'trailing' AS first; -- trailing single line
+ first
+----------
+ trailing
(1 row)
-QUERY:
SELECT /* embedded single line */ 'embedded' AS second;
-second
---------
-embedded
+ second
+----------
+ embedded
(1 row)
-QUERY: SELECT /* both embedded and trailing single line */ 'both' AS third;
-third
------
-both
+SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
+ third
+-------
+ both
(1 row)
-QUERY:
SELECT 'before multi-line' AS fourth;
-fourth
------------------
-before multi-line
+ fourth
+-------------------
+ before multi-line
(1 row)
-QUERY: /* This is an example of SQL which should not execute:
+/* This is an example of SQL which should not execute:
* select 'multi-line';
*/
SELECT 'after multi-line' AS fifth;
-fifth
-----------------
-after multi-line
+ fifth
+------------------
+ after multi-line
(1 row)
+/* and this is the end of the file */
-QUERY: SELECT ('today'::datetime = ('yesterday'::datetime + '1 day'::timespan)) as "True";
-True
-----
-t
+--
+-- DATETIME
+--
+-- Shorthand values
+-- Not directly usable for regression testing since these are not constants.
+-- So, just try to test parser and hope for the best - tgl 97/04/26
+SELECT (datetime 'today' = (datetime 'yesterday' + timespan '1 day')) as "True";
+ True
+------
+ t
(1 row)
-QUERY: SELECT ('today'::datetime = ('tomorrow'::datetime - '1 day'::timespan)) as "True";
-True
-----
-t
+SELECT (datetime 'today' = (datetime 'tomorrow' - timespan '1 day')) as "True";
+ True
+------
+ t
(1 row)
-QUERY: SELECT ('tomorrow'::datetime = ('yesterday'::datetime + '2 days'::timespan)) as "True";
-True
-----
-t
+SELECT (datetime 'tomorrow' = (datetime 'yesterday' + timespan '2 days')) as "True";
+ True
+------
+ t
(1 row)
-QUERY: SELECT ('current'::datetime = 'now'::datetime) as "True";
-True
-----
-t
+SELECT (datetime 'current' = 'now') as "True";
+ True
+------
+ t
(1 row)
-QUERY: SELECT ('now'::datetime - 'current'::datetime) AS "ZeroSecs";
-ZeroSecs
---------
-@ 0
+SELECT (datetime 'now' - 'current') AS "ZeroSecs";
+ ZeroSecs
+----------
+ @ 0
(1 row)
-QUERY: SET DateStyle = 'Postgres,noneuropean';
-QUERY: SELECT datetime('1994-01-01', '11:00') AS "Jan_01_1994_11am";
-Jan_01_1994_11am
-----------------------------
-Sat Jan 01 11:00:00 1994 PST
+SET DateStyle = 'Postgres,noneuropean';
+SELECT datetime('1994-01-01', '11:00') AS "Jan_01_1994_11am";
+ Jan_01_1994_11am
+------------------------------
+ Sat Jan 01 11:00:00 1994 PST
(1 row)
-QUERY: CREATE TABLE DATETIME_TBL( d1 datetime);
-QUERY: INSERT INTO DATETIME_TBL VALUES ('current');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('today');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('yesterday');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('tomorrow');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('tomorrow EST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('tomorrow zulu');
-QUERY: SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = 'today'::datetime;
-one
----
- 1
+CREATE TABLE DATETIME_TBL( d1 datetime);
+INSERT INTO DATETIME_TBL VALUES ('current');
+INSERT INTO DATETIME_TBL VALUES ('today');
+INSERT INTO DATETIME_TBL VALUES ('yesterday');
+INSERT INTO DATETIME_TBL VALUES ('tomorrow');
+INSERT INTO DATETIME_TBL VALUES ('tomorrow EST');
+INSERT INTO DATETIME_TBL VALUES ('tomorrow zulu');
+SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = datetime 'today';
+ one
+-----
+ 1
(1 row)
-QUERY: SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = 'tomorrow'::datetime;
-one
----
- 1
+SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = datetime 'tomorrow';
+ one
+-----
+ 1
(1 row)
-QUERY: SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = 'yesterday'::datetime;
-one
----
- 1
+SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = datetime 'yesterday';
+ one
+-----
+ 1
(1 row)
-QUERY: SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = 'today'::datetime + '1 day'::timespan;
-one
----
- 1
+SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = datetime 'today' + timespan '1 day';
+ one
+-----
+ 1
(1 row)
-QUERY: SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = 'today'::datetime - '1 day'::timespan;
-one
----
- 1
+SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = datetime 'today' - timespan '1 day';
+ one
+-----
+ 1
(1 row)
-QUERY: SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = 'now'::datetime;
-one
----
- 1
+SELECT count(*) AS one FROM DATETIME_TBL WHERE d1 = datetime 'now';
+ one
+-----
+ 1
(1 row)
-QUERY: DELETE FROM DATETIME_TBL;
-QUERY: INSERT INTO DATETIME_TBL VALUES ('current');
-QUERY: BEGIN;
-QUERY: INSERT INTO DATETIME_TBL VALUES ('now');
-QUERY: SELECT count(*) AS two FROM DATETIME_TBL WHERE d1 = 'now'::datetime;
-two
----
- 2
+DELETE FROM DATETIME_TBL;
+-- verify uniform transaction time within transaction block
+INSERT INTO DATETIME_TBL VALUES ('current');
+BEGIN;
+INSERT INTO DATETIME_TBL VALUES ('now');
+SELECT count(*) AS two FROM DATETIME_TBL WHERE d1 = datetime 'now';
+ two
+-----
+ 2
(1 row)
-QUERY: END;
-QUERY: DELETE FROM DATETIME_TBL;
-QUERY: INSERT INTO DATETIME_TBL VALUES ('invalid');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('-infinity');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('infinity');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('epoch');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Invalid Abstime');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Undefined Abstime');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-01-02');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-01-02 03:04:05');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01-08');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01-0800');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01 -08:00');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('19970210 173201 -0800');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-06-10 17:32:01 -07:00');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 10 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 10 5:32PM 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997/02/10 17:32:01-0800');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb-10-1997 17:32:01 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('02-10-1997 17:32:01 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('19970210 173201 PST');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('97FEB10 5:32:01PM UTC');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('97/02/10 17:32:01 UTC');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('97.041 17:32:01 UTC');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('1997-06-10 18:32:01 PDT');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 10 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 11 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 12 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 13 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 14 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 15 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 0097 BC');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 0097');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 0597');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1097');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1697');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1797');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1897');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 2097');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 28 17:32:01 1996');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 29 17:32:01 1996');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mar 01 17:32:01 1996');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Dec 30 17:32:01 1996');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 1996');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Jan 01 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 28 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 29 17:32:01 1997');
+END;
+DELETE FROM DATETIME_TBL;
+-- Special values
+INSERT INTO DATETIME_TBL VALUES ('invalid');
+INSERT INTO DATETIME_TBL VALUES ('-infinity');
+INSERT INTO DATETIME_TBL VALUES ('infinity');
+INSERT INTO DATETIME_TBL VALUES ('epoch');
+-- Postgres v6.0 standard output format
+INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+INSERT INTO DATETIME_TBL VALUES ('Invalid Abstime');
+INSERT INTO DATETIME_TBL VALUES ('Undefined Abstime');
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+INSERT INTO DATETIME_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+-- ISO 8601 format
+INSERT INTO DATETIME_TBL VALUES ('1997-01-02');
+INSERT INTO DATETIME_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO DATETIME_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO DATETIME_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+-- Variations for acceptable input formats
+INSERT INTO DATETIME_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO DATETIME_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO DATETIME_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO DATETIME_TBL VALUES ('1997-02-10 17:32:01 PST');
+INSERT INTO DATETIME_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+INSERT INTO DATETIME_TBL VALUES ('02-10-1997 17:32:01 PST');
+INSERT INTO DATETIME_TBL VALUES ('19970210 173201 PST');
+INSERT INTO DATETIME_TBL VALUES ('97FEB10 5:32:01PM UTC');
+INSERT INTO DATETIME_TBL VALUES ('97/02/10 17:32:01 UTC');
+INSERT INTO DATETIME_TBL VALUES ('97.041 17:32:01 UTC');
+-- Check date conversion and date arithmetic
+INSERT INTO DATETIME_TBL VALUES ('1997-06-10 18:32:01 PDT');
+INSERT INTO DATETIME_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO DATETIME_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO DATETIME_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO DATETIME_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO DATETIME_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO DATETIME_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Feb 29 17:32:01 1997');
ERROR: Bad datetime external representation 'Feb 29 17:32:01 1997'
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Mar 01 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Dec 30 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 1997');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 1999');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Jan 01 17:32:01 2000');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 2000');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Jan 01 17:32:01 2001');
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 -0097');
+INSERT INTO DATETIME_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO DATETIME_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO DATETIME_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO DATETIME_TBL VALUES ('Jan 01 17:32:01 2001');
+-- Currently unsupported syntax and ranges
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 -0097');
ERROR: Bad datetime external representation 'Feb 16 17:32:01 -0097'
-QUERY: INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+INSERT INTO DATETIME_TBL VALUES ('Feb 16 17:32:01 5097 BC');
ERROR: Datetime out of range 'Feb 16 17:32:01 5097 BC'
-QUERY: SELECT '' AS sixtythree, d1 FROM DATETIME_TBL;
-sixtythree|d1
-----------+-------------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |Mon Feb 10 17:32:01 1997 PST
- |invalid
- |invalid
- |Mon Feb 10 17:32:01.00 1997 PST
- |Mon Feb 10 17:32:02.00 1997 PST
- |Mon Feb 10 17:32:01.40 1997 PST
- |Mon Feb 10 17:32:01.50 1997 PST
- |Mon Feb 10 17:32:01.60 1997 PST
- |Thu Jan 02 00:00:00 1997 PST
- |Thu Jan 02 03:04:05 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Jun 10 17:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:00 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Tue Jun 10 18:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Feb 11 17:32:01 1997 PST
- |Wed Feb 12 17:32:01 1997 PST
- |Thu Feb 13 17:32:01 1997 PST
- |Fri Feb 14 17:32:01 1997 PST
- |Sat Feb 15 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Tue Feb 16 17:32 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 PST
- |Sat Feb 16 17:32:01 2097
- |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
- |Wed Jan 01 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
- |Fri Dec 31 17:32:01 1999 PST
- |Sat Jan 01 17:32:01 2000 PST
- |Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST
+SELECT '' AS sixtythree, d1 FROM DATETIME_TBL;
+ sixtythree | d1
+------------+---------------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | Mon Feb 10 17:32:01 1997 PST
+ | invalid
+ | invalid
+ | Mon Feb 10 17:32:01.00 1997 PST
+ | Mon Feb 10 17:32:02.00 1997 PST
+ | Mon Feb 10 17:32:01.40 1997 PST
+ | Mon Feb 10 17:32:01.50 1997 PST
+ | Mon Feb 10 17:32:01.60 1997 PST
+ | Thu Jan 02 00:00:00 1997 PST
+ | Thu Jan 02 03:04:05 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Jun 10 17:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:00 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Tue Jun 10 18:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Feb 11 17:32:01 1997 PST
+ | Wed Feb 12 17:32:01 1997 PST
+ | Thu Feb 13 17:32:01 1997 PST
+ | Fri Feb 14 17:32:01 1997 PST
+ | Sat Feb 15 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Tue Feb 16 17:32 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 PST
+ | Sat Feb 16 17:32:01 2097
+ | 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
+ | Wed Jan 01 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
+ | Fri Dec 31 17:32:01 1999 PST
+ | Sat Jan 01 17:32:01 2000 PST
+ | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST
(61 rows)
-QUERY: SELECT '' AS fortythree, d1 FROM DATETIME_TBL
- WHERE d1 > '1997-01-02'::datetime and d1 != 'current'::datetime;
-fortythree|d1
-----------+-------------------------------
- |infinity
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01.00 1997 PST
- |Mon Feb 10 17:32:02.00 1997 PST
- |Mon Feb 10 17:32:01.40 1997 PST
- |Mon Feb 10 17:32:01.50 1997 PST
- |Mon Feb 10 17:32:01.60 1997 PST
- |Thu Jan 02 03:04:05 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Jun 10 17:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:00 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Tue Jun 10 18:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Feb 11 17:32:01 1997 PST
- |Wed Feb 12 17:32:01 1997 PST
- |Thu Feb 13 17:32:01 1997 PST
- |Fri Feb 14 17:32:01 1997 PST
- |Sat Feb 15 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Sat Feb 16 17:32:01 2097
- |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
- |Fri Dec 31 17:32:01 1999 PST
- |Sat Jan 01 17:32:01 2000 PST
- |Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST
+-- Demonstrate functions and operators
+SELECT '' AS fortythree, d1 FROM DATETIME_TBL
+ WHERE d1 > datetime '1997-01-02' and d1 != datetime 'current';
+ fortythree | d1
+------------+---------------------------------
+ | infinity
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01.00 1997 PST
+ | Mon Feb 10 17:32:02.00 1997 PST
+ | Mon Feb 10 17:32:01.40 1997 PST
+ | Mon Feb 10 17:32:01.50 1997 PST
+ | Mon Feb 10 17:32:01.60 1997 PST
+ | Thu Jan 02 03:04:05 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Jun 10 17:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:00 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Tue Jun 10 18:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Feb 11 17:32:01 1997 PST
+ | Wed Feb 12 17:32:01 1997 PST
+ | Thu Feb 13 17:32:01 1997 PST
+ | Fri Feb 14 17:32:01 1997 PST
+ | Sat Feb 15 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Sat Feb 16 17:32:01 2097
+ | 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
+ | Fri Dec 31 17:32:01 1999 PST
+ | Sat Jan 01 17:32:01 2000 PST
+ | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST
(42 rows)
-QUERY: SELECT '' AS fifteen, d1 FROM DATETIME_TBL
- WHERE d1 < '1997-01-02'::datetime and d1 != 'current'::datetime;
-fifteen|d1
--------+----------------------------
- |-infinity
- |epoch
- |Tue Feb 16 17:32 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
- |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
- |Wed Jan 01 17:32:01 1997 PST
+SELECT '' AS fifteen, d1 FROM DATETIME_TBL
+ WHERE d1 < datetime '1997-01-02' and d1 != datetime 'current';
+ fifteen | d1
+---------+------------------------------
+ | -infinity
+ | epoch
+ | Tue Feb 16 17:32 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
+ | 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
+ | Wed Jan 01 17:32:01 1997 PST
(15 rows)
-QUERY: SELECT '' AS one, d1 FROM DATETIME_TBL
- WHERE d1 = '1997-01-02'::datetime and d1 != 'current'::datetime;
-one|d1
----+----------------------------
- |Thu Jan 02 00:00:00 1997 PST
+SELECT '' AS one, d1 FROM DATETIME_TBL
+ WHERE d1 = datetime '1997-01-02' and d1 != datetime 'current';
+ one | d1
+-----+------------------------------
+ | Thu Jan 02 00:00:00 1997 PST
(1 row)
-QUERY: SELECT '' AS fiftyeight, d1 FROM DATETIME_TBL
- WHERE d1 != '1997-01-02'::datetime and d1 != 'current'::datetime;
-fiftyeight|d1
-----------+-------------------------------
- |-infinity
- |infinity
- |epoch
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01.00 1997 PST
- |Mon Feb 10 17:32:02.00 1997 PST
- |Mon Feb 10 17:32:01.40 1997 PST
- |Mon Feb 10 17:32:01.50 1997 PST
- |Mon Feb 10 17:32:01.60 1997 PST
- |Thu Jan 02 03:04:05 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Jun 10 17:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:00 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Tue Jun 10 18:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Feb 11 17:32:01 1997 PST
- |Wed Feb 12 17:32:01 1997 PST
- |Thu Feb 13 17:32:01 1997 PST
- |Fri Feb 14 17:32:01 1997 PST
- |Sat Feb 15 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Tue Feb 16 17:32 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 PST
- |Sat Feb 16 17:32:01 2097
- |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
- |Wed Jan 01 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
- |Fri Dec 31 17:32:01 1999 PST
- |Sat Jan 01 17:32:01 2000 PST
- |Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST
+SELECT '' AS fiftyeight, d1 FROM DATETIME_TBL
+ WHERE d1 != datetime '1997-01-02' and d1 != datetime 'current';
+ fiftyeight | d1
+------------+---------------------------------
+ | -infinity
+ | infinity
+ | epoch
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01.00 1997 PST
+ | Mon Feb 10 17:32:02.00 1997 PST
+ | Mon Feb 10 17:32:01.40 1997 PST
+ | Mon Feb 10 17:32:01.50 1997 PST
+ | Mon Feb 10 17:32:01.60 1997 PST
+ | Thu Jan 02 03:04:05 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Jun 10 17:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:00 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Tue Jun 10 18:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Feb 11 17:32:01 1997 PST
+ | Wed Feb 12 17:32:01 1997 PST
+ | Thu Feb 13 17:32:01 1997 PST
+ | Fri Feb 14 17:32:01 1997 PST
+ | Sat Feb 15 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Tue Feb 16 17:32 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 PST
+ | Sat Feb 16 17:32:01 2097
+ | 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
+ | Wed Jan 01 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
+ | Fri Dec 31 17:32:01 1999 PST
+ | Sat Jan 01 17:32:01 2000 PST
+ | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST
(57 rows)
-QUERY: SELECT '' AS sixteen, d1 FROM DATETIME_TBL
- WHERE d1 <= '1997-01-02'::datetime and d1 != 'current'::datetime;
-sixteen|d1
--------+----------------------------
- |-infinity
- |epoch
- |Thu Jan 02 00:00:00 1997 PST
- |Tue Feb 16 17:32 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
- |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
- |Wed Jan 01 17:32:01 1997 PST
+SELECT '' AS sixteen, d1 FROM DATETIME_TBL
+ WHERE d1 <= datetime '1997-01-02' and d1 != datetime 'current';
+ sixteen | d1
+---------+------------------------------
+ | -infinity
+ | epoch
+ | Thu Jan 02 00:00:00 1997 PST
+ | Tue Feb 16 17:32 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
+ | 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
+ | Wed Jan 01 17:32:01 1997 PST
(16 rows)
-QUERY: SELECT '' AS fortyfour, d1 FROM DATETIME_TBL
- WHERE d1 >= '1997-01-02'::datetime and d1 != 'current'::datetime;
-fortyfour|d1
----------+-------------------------------
- |infinity
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01.00 1997 PST
- |Mon Feb 10 17:32:02.00 1997 PST
- |Mon Feb 10 17:32:01.40 1997 PST
- |Mon Feb 10 17:32:01.50 1997 PST
- |Mon Feb 10 17:32:01.60 1997 PST
- |Thu Jan 02 00:00:00 1997 PST
- |Thu Jan 02 03:04:05 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Jun 10 17:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:00 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Tue Jun 10 18:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Feb 11 17:32:01 1997 PST
- |Wed Feb 12 17:32:01 1997 PST
- |Thu Feb 13 17:32:01 1997 PST
- |Fri Feb 14 17:32:01 1997 PST
- |Sat Feb 15 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Sat Feb 16 17:32:01 2097
- |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
- |Fri Dec 31 17:32:01 1999 PST
- |Sat Jan 01 17:32:01 2000 PST
- |Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST
+SELECT '' AS fortyfour, d1 FROM DATETIME_TBL
+ WHERE d1 >= datetime '1997-01-02' and d1 != datetime 'current';
+ fortyfour | d1
+-----------+---------------------------------
+ | infinity
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01.00 1997 PST
+ | Mon Feb 10 17:32:02.00 1997 PST
+ | Mon Feb 10 17:32:01.40 1997 PST
+ | Mon Feb 10 17:32:01.50 1997 PST
+ | Mon Feb 10 17:32:01.60 1997 PST
+ | Thu Jan 02 00:00:00 1997 PST
+ | Thu Jan 02 03:04:05 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Jun 10 17:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:00 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Tue Jun 10 18:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Feb 11 17:32:01 1997 PST
+ | Wed Feb 12 17:32:01 1997 PST
+ | Thu Feb 13 17:32:01 1997 PST
+ | Fri Feb 14 17:32:01 1997 PST
+ | Sat Feb 15 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Sat Feb 16 17:32:01 2097
+ | 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
+ | Fri Dec 31 17:32:01 1999 PST
+ | Sat Jan 01 17:32:01 2000 PST
+ | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST
(43 rows)
-QUERY: SELECT '' AS sixtythree, d1 + '1 year'::timespan AS one_year FROM DATETIME_TBL;
-sixtythree|one_year
-----------+-------------------------------
- |invalid
- |-infinity
- |infinity
- |Thu Dec 31 16:00:00 1970 PST
- |Tue Feb 10 17:32:01 1998 PST
- |invalid
- |invalid
- |Tue Feb 10 17:32:01.00 1998 PST
- |Tue Feb 10 17:32:02.00 1998 PST
- |Tue Feb 10 17:32:01.40 1998 PST
- |Tue Feb 10 17:32:01.50 1998 PST
- |Tue Feb 10 17:32:01.60 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
- |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
- |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 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 PST
- |Sun Feb 16 17:32:01 2098
- |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
+SELECT '' AS sixtythree, d1 + timespan '1 year' AS one_year FROM DATETIME_TBL;
+ sixtythree | one_year
+------------+---------------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | Thu Dec 31 16:00:00 1970 PST
+ | Tue Feb 10 17:32:01 1998 PST
+ | invalid
+ | invalid
+ | Tue Feb 10 17:32:01.00 1998 PST
+ | Tue Feb 10 17:32:02.00 1998 PST
+ | Tue Feb 10 17:32:01.40 1998 PST
+ | Tue Feb 10 17:32:01.50 1998 PST
+ | Tue Feb 10 17:32:01.60 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
+ | 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
+ | 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 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 PST
+ | Sun Feb 16 17:32:01 2098
+ | 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
(61 rows)
-QUERY: SELECT '' AS sixtythree, d1 - '1 year'::timespan AS one_year FROM DATETIME_TBL;
-sixtythree|one_year
-----------+-------------------------------
- |invalid
- |-infinity
- |infinity
- |Tue Dec 31 16:00:00 1968 PST
- |Sat Feb 10 17:32:01 1996 PST
- |invalid
- |invalid
- |Sat Feb 10 17:32:01.00 1996 PST
- |Sat Feb 10 17:32:02.00 1996 PST
- |Sat Feb 10 17:32:01.40 1996 PST
- |Sat Feb 10 17:32:01.50 1996 PST
- |Sat Feb 10 17:32:01.60 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
- |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
- |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 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 PST
- |Thu Feb 16 17:32:01 2096
- |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
+SELECT '' AS sixtythree, d1 - timespan '1 year' AS one_year FROM DATETIME_TBL;
+ sixtythree | one_year
+------------+---------------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | Tue Dec 31 16:00:00 1968 PST
+ | Sat Feb 10 17:32:01 1996 PST
+ | invalid
+ | invalid
+ | Sat Feb 10 17:32:01.00 1996 PST
+ | Sat Feb 10 17:32:02.00 1996 PST
+ | Sat Feb 10 17:32:01.40 1996 PST
+ | Sat Feb 10 17:32:01.50 1996 PST
+ | Sat Feb 10 17:32:01.60 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
+ | 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
+ | 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 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 PST
+ | Thu Feb 16 17:32:01 2096
+ | 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
(61 rows)
-QUERY: SELECT '' AS fifty, d1 - '1997-01-02'::datetime AS diff
+-- Casting within a BETWEEN qualifier should probably be allowed by the parser. - tgl 97/04/26
+--SELECT '' AS fifty, d1 - datetime '1997-01-02' AS diff
+-- FROM DATETIME_TBL WHERE d1 BETWEEN datetime '1902-01-01' AND datetime '2038-01-01';
+SELECT '' AS fifty, d1 - datetime '1997-01-02' AS diff
FROM DATETIME_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
-fifty|diff
------+--------------------------------------
- |@ 9863 days 8 hours ago
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1.00 secs
- |@ 39 days 17 hours 32 mins 2.00 secs
- |@ 39 days 17 hours 32 mins 1.40 secs
- |@ 39 days 17 hours 32 mins 1.50 secs
- |@ 39 days 17 hours 32 mins 1.60 secs
- |@ 0
- |@ 3 hours 4 mins 5 secs
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 159 days 16 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 39 days 9 hours 32 mins 1 sec
- |@ 39 days 9 hours 32 mins 1 sec
- |@ 39 days 9 hours 32 mins 1 sec
- |@ 159 days 17 hours 32 mins 1 sec
- |@ 39 days 17 hours 32 mins 1 sec
- |@ 40 days 17 hours 32 mins 1 sec
- |@ 41 days 17 hours 32 mins 1 sec
- |@ 42 days 17 hours 32 mins 1 sec
- |@ 43 days 17 hours 32 mins 1 sec
- |@ 44 days 17 hours 32 mins 1 sec
- |@ 45 days 17 hours 32 mins 1 sec
- |@ 45 days 17 hours 32 mins 1 sec
- |@ 308 days 6 hours 27 mins 59 secs ago
- |@ 307 days 6 hours 27 mins 59 secs ago
- |@ 306 days 6 hours 27 mins 59 secs ago
- |@ 2 days 6 hours 27 mins 59 secs ago
- |@ 1 day 6 hours 27 mins 59 secs ago
- |@ 6 hours 27 mins 59 secs ago
- |@ 57 days 17 hours 32 mins 1 sec
- |@ 58 days 17 hours 32 mins 1 sec
- |@ 362 days 17 hours 32 mins 1 sec
- |@ 363 days 17 hours 32 mins 1 sec
- |@ 1093 days 17 hours 32 mins 1 sec
- |@ 1094 days 17 hours 32 mins 1 sec
- |@ 1459 days 17 hours 32 mins 1 sec
- |@ 1460 days 17 hours 32 mins 1 sec
+ fifty | diff
+-------+----------------------------------------
+ | @ 9863 days 8 hours ago
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1.00 secs
+ | @ 39 days 17 hours 32 mins 2.00 secs
+ | @ 39 days 17 hours 32 mins 1.40 secs
+ | @ 39 days 17 hours 32 mins 1.50 secs
+ | @ 39 days 17 hours 32 mins 1.60 secs
+ | @ 0
+ | @ 3 hours 4 mins 5 secs
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 159 days 16 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 39 days 9 hours 32 mins 1 sec
+ | @ 39 days 9 hours 32 mins 1 sec
+ | @ 39 days 9 hours 32 mins 1 sec
+ | @ 159 days 17 hours 32 mins 1 sec
+ | @ 39 days 17 hours 32 mins 1 sec
+ | @ 40 days 17 hours 32 mins 1 sec
+ | @ 41 days 17 hours 32 mins 1 sec
+ | @ 42 days 17 hours 32 mins 1 sec
+ | @ 43 days 17 hours 32 mins 1 sec
+ | @ 44 days 17 hours 32 mins 1 sec
+ | @ 45 days 17 hours 32 mins 1 sec
+ | @ 45 days 17 hours 32 mins 1 sec
+ | @ 308 days 6 hours 27 mins 59 secs ago
+ | @ 307 days 6 hours 27 mins 59 secs ago
+ | @ 306 days 6 hours 27 mins 59 secs ago
+ | @ 2 days 6 hours 27 mins 59 secs ago
+ | @ 1 day 6 hours 27 mins 59 secs ago
+ | @ 6 hours 27 mins 59 secs ago
+ | @ 57 days 17 hours 32 mins 1 sec
+ | @ 58 days 17 hours 32 mins 1 sec
+ | @ 362 days 17 hours 32 mins 1 sec
+ | @ 363 days 17 hours 32 mins 1 sec
+ | @ 1093 days 17 hours 32 mins 1 sec
+ | @ 1094 days 17 hours 32 mins 1 sec
+ | @ 1459 days 17 hours 32 mins 1 sec
+ | @ 1460 days 17 hours 32 mins 1 sec
(48 rows)
-QUERY: SELECT '' AS fortynine, date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
+SELECT '' AS fortynine, date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
FROM DATETIME_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
-fortynine|year|month|day|hour|minute| second
----------+----+-----+---+----+------+--------
- |1969| 12| 31| 16| 0| 0
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32|1.000001
- |1997| 2| 10| 17| 32|1.999999
- |1997| 2| 10| 17| 32| 1.4
- |1997| 2| 10| 17| 32| 1.5
- |1997| 2| 10| 17| 32| 1.6
- |1997| 1| 2| 0| 0| 0
- |1997| 1| 2| 3| 4| 5
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 6| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 0
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 10| 9| 32| 1
- |1997| 2| 10| 9| 32| 1
- |1997| 2| 10| 9| 32| 1
- |1997| 6| 10| 18| 32| 1
- |1997| 2| 10| 17| 32| 1
- |1997| 2| 11| 17| 32| 1
- |1997| 2| 12| 17| 32| 1
- |1997| 2| 13| 17| 32| 1
- |1997| 2| 14| 17| 32| 1
- |1997| 2| 15| 17| 32| 1
- |1997| 2| 16| 17| 32| 1
- |1997| 2| 16| 17| 32| 1
- |1996| 2| 28| 17| 32| 1
- |1996| 2| 29| 17| 32| 1
- |1996| 3| 1| 17| 32| 1
- |1996| 12| 30| 17| 32| 1
- |1996| 12| 31| 17| 32| 1
- |1997| 1| 1| 17| 32| 1
- |1997| 2| 28| 17| 32| 1
- |1997| 3| 1| 17| 32| 1
- |1997| 12| 30| 17| 32| 1
- |1997| 12| 31| 17| 32| 1
- |1999| 12| 31| 17| 32| 1
- |2000| 1| 1| 17| 32| 1
- |2000| 12| 31| 17| 32| 1
- |2001| 1| 1| 17| 32| 1
+ fortynine | year | month | day | hour | minute | second
+-----------+------+-------+-----+------+--------+----------
+ | 1969 | 12 | 31 | 16 | 0 | 0
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1.000001
+ | 1997 | 2 | 10 | 17 | 32 | 1.999999
+ | 1997 | 2 | 10 | 17 | 32 | 1.4
+ | 1997 | 2 | 10 | 17 | 32 | 1.5
+ | 1997 | 2 | 10 | 17 | 32 | 1.6
+ | 1997 | 1 | 2 | 0 | 0 | 0
+ | 1997 | 1 | 2 | 3 | 4 | 5
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 6 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 0
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 10 | 9 | 32 | 1
+ | 1997 | 2 | 10 | 9 | 32 | 1
+ | 1997 | 2 | 10 | 9 | 32 | 1
+ | 1997 | 6 | 10 | 18 | 32 | 1
+ | 1997 | 2 | 10 | 17 | 32 | 1
+ | 1997 | 2 | 11 | 17 | 32 | 1
+ | 1997 | 2 | 12 | 17 | 32 | 1
+ | 1997 | 2 | 13 | 17 | 32 | 1
+ | 1997 | 2 | 14 | 17 | 32 | 1
+ | 1997 | 2 | 15 | 17 | 32 | 1
+ | 1997 | 2 | 16 | 17 | 32 | 1
+ | 1997 | 2 | 16 | 17 | 32 | 1
+ | 1996 | 2 | 28 | 17 | 32 | 1
+ | 1996 | 2 | 29 | 17 | 32 | 1
+ | 1996 | 3 | 1 | 17 | 32 | 1
+ | 1996 | 12 | 30 | 17 | 32 | 1
+ | 1996 | 12 | 31 | 17 | 32 | 1
+ | 1997 | 1 | 1 | 17 | 32 | 1
+ | 1997 | 2 | 28 | 17 | 32 | 1
+ | 1997 | 3 | 1 | 17 | 32 | 1
+ | 1997 | 12 | 30 | 17 | 32 | 1
+ | 1997 | 12 | 31 | 17 | 32 | 1
+ | 1999 | 12 | 31 | 17 | 32 | 1
+ | 2000 | 1 | 1 | 17 | 32 | 1
+ | 2000 | 12 | 31 | 17 | 32 | 1
+ | 2001 | 1 | 1 | 17 | 32 | 1
(48 rows)
-QUERY: SELECT '' AS fortynine, date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
+SELECT '' AS fortynine, date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
date_part( 'usec', d1) AS usec
FROM DATETIME_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
-fortynine|quarter| msec| usec
----------+-------+--------------------+-----------------
- | 4| 0| 0
- | 1| 0| 0
- | 1|0.000999999999917733|0.999999999917733
- | 1| 999.999| 999999
- | 1| 400| 400000
- | 1| 500| 500000
- | 1| 600| 600000
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 2| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 2| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 4| 0| 0
- | 4| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 1| 0| 0
- | 4| 0| 0
- | 4| 0| 0
- | 4| 0| 0
- | 1| 0| 0
- | 4| 0| 0
- | 1| 0| 0
+ fortynine | quarter | msec | usec
+-----------+---------+----------------------+-------------------
+ | 4 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0.000999999999917733 | 0.999999999917733
+ | 1 | 999.999 | 999999
+ | 1 | 400 | 400000
+ | 1 | 500 | 500000
+ | 1 | 600 | 600000
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 2 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 2 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 4 | 0 | 0
+ | 4 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 1 | 0 | 0
+ | 4 | 0 | 0
+ | 4 | 0 | 0
+ | 4 | 0 | 0
+ | 1 | 0 | 0
+ | 4 | 0 | 0
+ | 1 | 0 | 0
(48 rows)
-QUERY: SELECT '' AS four, center(f1) AS center
+--
+-- GEOMETRY
+--
+--
+-- Points
+--
+SELECT '' AS four, center(f1) AS center
FROM BOX_TBL;
-four|center
-----+-------
- |(1,1)
- |(2,2)
- |(2.5,3)
- |(3,3)
+ four | center
+------+---------
+ | (1,1)
+ | (2,2)
+ | (2.5,3)
+ | (3,3)
(4 rows)
-QUERY: SELECT '' AS four, (@@ f1) AS center
+SELECT '' AS four, (@@ f1) AS center
FROM BOX_TBL;
-four|center
-----+-------
- |(1,1)
- |(2,2)
- |(2.5,3)
- |(3,3)
+ four | center
+------+---------
+ | (1,1)
+ | (2,2)
+ | (2.5,3)
+ | (3,3)
(4 rows)
-QUERY: SELECT '' AS six, point(f1) AS center
+SELECT '' AS six, point(f1) AS center
FROM CIRCLE_TBL;
-six|center
----+---------
- |(0,0)
- |(1,2)
- |(1,3)
- |(1,2)
- |(100,200)
- |(100,0)
+ six | center
+-----+-----------
+ | (0,0)
+ | (1,2)
+ | (1,3)
+ | (1,2)
+ | (100,200)
+ | (100,0)
(6 rows)
-QUERY: SELECT '' AS six, (@@ f1) AS center
+SELECT '' AS six, (@@ f1) AS center
FROM CIRCLE_TBL;
-six|center
----+---------
- |(0,0)
- |(1,2)
- |(1,3)
- |(1,2)
- |(100,200)
- |(100,0)
+ six | center
+-----+-----------
+ | (0,0)
+ | (1,2)
+ | (1,3)
+ | (1,2)
+ | (100,200)
+ | (100,0)
(6 rows)
-QUERY: SELECT '' AS two, (@@ f1) AS center
+SELECT '' AS two, (@@ f1) AS center
FROM POLYGON_TBL
WHERE (# f1) > 2;
-two|center
----+-----------------------------------
- |(1.33333333333333,1.33333333333333)
- |(2.33333333333333,1.33333333333333)
+ two | center
+-----+-------------------------------------
+ | (1.33333333333333,1.33333333333333)
+ | (2.33333333333333,1.33333333333333)
(2 rows)
-QUERY: SELECT '' AS two, p1.f1
+-- "is horizontal" function
+SELECT '' AS two, p1.f1
FROM POINT_TBL p1
- WHERE ishorizontal(p1.f1, '(0,0)'::point);
-two|f1
----+-------
- |(0,0)
- |(-10,0)
+ WHERE ishorizontal(p1.f1, point '(0,0)');
+ two | f1
+-----+---------
+ | (0,0)
+ | (-10,0)
(2 rows)
-QUERY: SELECT '' AS two, p1.f1
+-- "is horizontal" operator
+SELECT '' AS two, p1.f1
FROM POINT_TBL p1
- WHERE p1.f1 ?- '(0,0)'::point;
-two|f1
----+-------
- |(0,0)
- |(-10,0)
+ WHERE p1.f1 ?- point '(0,0)';
+ two | f1
+-----+---------
+ | (0,0)
+ | (-10,0)
(2 rows)
-QUERY: SELECT '' AS one, p1.f1
+-- "is vertical" function
+SELECT '' AS one, p1.f1
FROM POINT_TBL p1
- WHERE isvertical(p1.f1, '(5.1,34.5)'::point);
-one|f1
----+----------
- |(5.1,34.5)
+ WHERE isvertical(p1.f1, point '(5.1,34.5)');
+ one | f1
+-----+------------
+ | (5.1,34.5)
(1 row)
-QUERY: SELECT '' AS one, p1.f1
+-- "is vertical" operator
+SELECT '' AS one, p1.f1
FROM POINT_TBL p1
- WHERE p1.f1 ?| '(5.1,34.5)'::point;
-one|f1
----+----------
- |(5.1,34.5)
+ WHERE p1.f1 ?| point '(5.1,34.5)';
+ one | f1
+-----+------------
+ | (5.1,34.5)
(1 row)
-QUERY: SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
+--
+-- Line segments
+--
+-- intersection
+SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
FROM LSEG_TBL l, POINT_TBL p;
ERROR: Unable to identify an operator '#' for types 'lseg' and 'point'
You will have to retype this query using an explicit cast
-QUERY: SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
+-- closest point
+SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
FROM LSEG_TBL l, POINT_TBL p;
-thirty|f1 |s |closest
-------+----------+-----------------------------+-------------------------------------
- |(0,0) |[(1,2),(3,4)] |(1,2)
- |(-10,0) |[(1,2),(3,4)] |(1,2)
- |(-3,4) |[(1,2),(3,4)] |(1,2)
- |(5.1,34.5)|[(1,2),(3,4)] |(3,4)
- |(-5,-12) |[(1,2),(3,4)] |(1,2)
- |(10,10) |[(1,2),(3,4)] |(3,4)
- |(0,0) |[(0,0),(6,6)] |(-0,0)
- |(-10,0) |[(0,0),(6,6)] |(0,0)
- |(-3,4) |[(0,0),(6,6)] |(0.5,0.5)
- |(5.1,34.5)|[(0,0),(6,6)] |(6,6)
- |(-5,-12) |[(0,0),(6,6)] |(0,0)
- |(10,10) |[(0,0),(6,6)] |(6,6)
- |(0,0) |[(10,-10),(-3,-4)] |(-2.04878048780488,-4.4390243902439)
- |(-10,0) |[(10,-10),(-3,-4)] |(-3,-4)
- |(-3,4) |[(10,-10),(-3,-4)] |(-3,-4)
- |(5.1,34.5)|[(10,-10),(-3,-4)] |(-3,-4)
- |(-5,-12) |[(10,-10),(-3,-4)] |(-1.60487804878049,-4.64390243902439)
- |(10,10) |[(10,-10),(-3,-4)] |(2.39024390243902,-6.48780487804878)
- |(0,0) |[(-1000000,200),(300000,-40)]|(0.0028402365895872,15.384614860264)
- |(-10,0) |[(-1000000,200),(300000,-40)]|(-9.99715942258202,15.3864610140473)
- |(-3,4) |[(-1000000,200),(300000,-40)]|(-2.99789812267519,15.3851688427303)
- |(5.1,34.5)|[(-1000000,200),(300000,-40)]|(5.09647083221496,15.3836744976925)
- |(-5,-12) |[(-1000000,200),(300000,-40)]|(-4.99494420845634,15.3855375281616)
- |(10,10) |[(-1000000,200),(300000,-40)]|(10.000993741978,15.3827690473092)
- |(0,0) |[(11,22),(33,44)] |(11,22)
- |(-10,0) |[(11,22),(33,44)] |(11,22)
- |(-3,4) |[(11,22),(33,44)] |(11,22)
- |(5.1,34.5)|[(11,22),(33,44)] |(14.3,25.3)
- |(-5,-12) |[(11,22),(33,44)] |(11,22)
- |(10,10) |[(11,22),(33,44)] |(11,22)
+ thirty | f1 | s | closest
+--------+------------+-------------------------------+---------------------------------------
+ | (0,0) | [(1,2),(3,4)] | (1,2)
+ | (-10,0) | [(1,2),(3,4)] | (1,2)
+ | (-3,4) | [(1,2),(3,4)] | (1,2)
+ | (5.1,34.5) | [(1,2),(3,4)] | (3,4)
+ | (-5,-12) | [(1,2),(3,4)] | (1,2)
+ | (10,10) | [(1,2),(3,4)] | (3,4)
+ | (0,0) | [(0,0),(6,6)] | (-0,0)
+ | (-10,0) | [(0,0),(6,6)] | (0,0)
+ | (-3,4) | [(0,0),(6,6)] | (0.5,0.5)
+ | (5.1,34.5) | [(0,0),(6,6)] | (6,6)
+ | (-5,-12) | [(0,0),(6,6)] | (0,0)
+ | (10,10) | [(0,0),(6,6)] | (6,6)
+ | (0,0) | [(10,-10),(-3,-4)] | (-2.04878048780488,-4.4390243902439)
+ | (-10,0) | [(10,-10),(-3,-4)] | (-3,-4)
+ | (-3,4) | [(10,-10),(-3,-4)] | (-3,-4)
+ | (5.1,34.5) | [(10,-10),(-3,-4)] | (-3,-4)
+ | (-5,-12) | [(10,-10),(-3,-4)] | (-1.60487804878049,-4.64390243902439)
+ | (10,10) | [(10,-10),(-3,-4)] | (2.39024390243902,-6.48780487804878)
+ | (0,0) | [(-1000000,200),(300000,-40)] | (0.0028402365895872,15.384614860264)
+ | (-10,0) | [(-1000000,200),(300000,-40)] | (-9.99715942258202,15.3864610140473)
+ | (-3,4) | [(-1000000,200),(300000,-40)] | (-2.99789812267519,15.3851688427303)
+ | (5.1,34.5) | [(-1000000,200),(300000,-40)] | (5.09647083221496,15.3836744976925)
+ | (-5,-12) | [(-1000000,200),(300000,-40)] | (-4.99494420845634,15.3855375281616)
+ | (10,10) | [(-1000000,200),(300000,-40)] | (10.000993741978,15.3827690473092)
+ | (0,0) | [(11,22),(33,44)] | (11,22)
+ | (-10,0) | [(11,22),(33,44)] | (11,22)
+ | (-3,4) | [(11,22),(33,44)] | (11,22)
+ | (5.1,34.5) | [(11,22),(33,44)] | (14.3,25.3)
+ | (-5,-12) | [(11,22),(33,44)] | (11,22)
+ | (10,10) | [(11,22),(33,44)] | (11,22)
(30 rows)
-QUERY: SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL;
-six|box
----+--------------------------------------------------------------------------
- |(2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964)
- |(71.7106781186548,72.7106781186548),(-69.7106781186548,-68.7106781186548)
- |(4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932738)
- |(3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559643)
- |(107.071067811865,207.071067811865),(92.9289321881345,192.928932188135)
- |(170.710678118655,70.7106781186548),(29.2893218813452,-70.7106781186548)
+--
+-- Lines
+--
+--
+-- Boxes
+--
+SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL;
+ six | box
+-----+----------------------------------------------------------------------------
+ | (2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964)
+ | (71.7106781186547,72.7106781186547),(-69.7106781186547,-68.7106781186547)
+ | (4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932737)
+ | (3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559642)
+ | (107.071067811865,207.071067811865),(92.9289321881345,192.928932188135)
+ | (170.710678118655,70.7106781186547),(29.2893218813453,-70.7106781186547)
(6 rows)
-QUERY: SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
+-- translation
+SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
FROM BOX_TBL b, POINT_TBL p;
-twentyfour|translation
-----------+-----------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
- |(-8,2),(-10,0)
- |(-7,3),(-9,1)
- |(-7.5,3.5),(-7.5,2.5)
- |(-7,3),(-7,3)
- |(-1,6),(-3,4)
- |(0,7),(-2,5)
- |(-0.5,7.5),(-0.5,6.5)
- |(0,7),(0,7)
- |(7.1,36.5),(5.1,34.5)
- |(8.1,37.5),(6.1,35.5)
- |(7.6,38),(7.6,37)
- |(8.1,37.5),(8.1,37.5)
- |(-3,-10),(-5,-12)
- |(-2,-9),(-4,-11)
- |(-2.5,-8.5),(-2.5,-9.5)
- |(-2,-9),(-2,-9)
- |(12,12),(10,10)
- |(13,13),(11,11)
- |(12.5,13.5),(12.5,12.5)
- |(13,13),(13,13)
+ twentyfour | translation
+------------+-------------------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (2.5,3.5),(2.5,2.5)
+ | (3,3),(3,3)
+ | (-8,2),(-10,0)
+ | (-7,3),(-9,1)
+ | (-7.5,3.5),(-7.5,2.5)
+ | (-7,3),(-7,3)
+ | (-1,6),(-3,4)
+ | (0,7),(-2,5)
+ | (-0.5,7.5),(-0.5,6.5)
+ | (0,7),(0,7)
+ | (7.1,36.5),(5.1,34.5)
+ | (8.1,37.5),(6.1,35.5)
+ | (7.6,38),(7.6,37)
+ | (8.1,37.5),(8.1,37.5)
+ | (-3,-10),(-5,-12)
+ | (-2,-9),(-4,-11)
+ | (-2.5,-8.5),(-2.5,-9.5)
+ | (-2,-9),(-2,-9)
+ | (12,12),(10,10)
+ | (13,13),(11,11)
+ | (12.5,13.5),(12.5,12.5)
+ | (13,13),(13,13)
(24 rows)
-QUERY: SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
+SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
FROM BOX_TBL b, POINT_TBL p;
-twentyfour|translation
-----------+-------------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
- |(12,2),(10,0)
- |(13,3),(11,1)
- |(12.5,3.5),(12.5,2.5)
- |(13,3),(13,3)
- |(5,-2),(3,-4)
- |(6,-1),(4,-3)
- |(5.5,-0.5),(5.5,-1.5)
- |(6,-1),(6,-1)
- |(-3.1,-32.5),(-5.1,-34.5)
- |(-2.1,-31.5),(-4.1,-33.5)
- |(-2.6,-31),(-2.6,-32)
- |(-2.1,-31.5),(-2.1,-31.5)
- |(7,14),(5,12)
- |(8,15),(6,13)
- |(7.5,15.5),(7.5,14.5)
- |(8,15),(8,15)
- |(-8,-8),(-10,-10)
- |(-7,-7),(-9,-9)
- |(-7.5,-6.5),(-7.5,-7.5)
- |(-7,-7),(-7,-7)
+ twentyfour | translation
+------------+---------------------------
+ | (2,2),(0,0)
+ | (3,3),(1,1)
+ | (2.5,3.5),(2.5,2.5)
+ | (3,3),(3,3)
+ | (12,2),(10,0)
+ | (13,3),(11,1)
+ | (12.5,3.5),(12.5,2.5)
+ | (13,3),(13,3)
+ | (5,-2),(3,-4)
+ | (6,-1),(4,-3)
+ | (5.5,-0.5),(5.5,-1.5)
+ | (6,-1),(6,-1)
+ | (-3.1,-32.5),(-5.1,-34.5)
+ | (-2.1,-31.5),(-4.1,-33.5)
+ | (-2.6,-31),(-2.6,-32)
+ | (-2.1,-31.5),(-2.1,-31.5)
+ | (7,14),(5,12)
+ | (8,15),(6,13)
+ | (7.5,15.5),(7.5,14.5)
+ | (8,15),(8,15)
+ | (-8,-8),(-10,-10)
+ | (-7,-7),(-9,-9)
+ | (-7.5,-6.5),(-7.5,-7.5)
+ | (-7,-7),(-7,-7)
(24 rows)
-QUERY: SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
+-- scaling and rotation
+SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
-twentyfour|rotation
-----------+---------------------------
- |(0,0),(0,0)
- |(0,0),(0,0)
- |(0,0),(0,0)
- |(0,0),(0,0)
- |(-0,0),(-20,-20)
- |(-10,-10),(-30,-30)
- |(-25,-25),(-25,-35)
- |(-30,-30),(-30,-30)
- |(-0,2),(-14,0)
- |(-7,3),(-21,1)
- |(-17.5,2.5),(-21.5,-0.5)
- |(-21,3),(-21,3)
- |(0,79.2),(-58.8,0)
- |(-29.4,118.8),(-88.2,39.6)
- |(-73.5,104.1),(-108,99)
- |(-88.2,118.8),(-88.2,118.8)
- |(14,-0),(0,-34)
- |(21,-17),(7,-51)
- |(29.5,-42.5),(17.5,-47.5)
- |(21,-51),(21,-51)
- |(0,40),(0,0)
- |(0,60),(0,20)
- |(0,60),(-10,50)
- |(0,60),(0,60)
+ twentyfour | rotation
+------------+-----------------------------
+ | (0,0),(0,0)
+ | (0,0),(0,0)
+ | (0,0),(0,0)
+ | (0,0),(0,0)
+ | (-0,0),(-20,-20)
+ | (-10,-10),(-30,-30)
+ | (-25,-25),(-25,-35)
+ | (-30,-30),(-30,-30)
+ | (-0,2),(-14,0)
+ | (-7,3),(-21,1)
+ | (-17.5,2.5),(-21.5,-0.5)
+ | (-21,3),(-21,3)
+ | (0,79.2),(-58.8,0)
+ | (-29.4,118.8),(-88.2,39.6)
+ | (-73.5,104.1),(-108,99)
+ | (-88.2,118.8),(-88.2,118.8)
+ | (14,-0),(0,-34)
+ | (21,-17),(7,-51)
+ | (29.5,-42.5),(17.5,-47.5)
+ | (21,-51),(21,-51)
+ | (0,40),(0,0)
+ | (0,60),(0,20)
+ | (0,60),(-10,50)
+ | (0,60),(0,60)
(24 rows)
-QUERY: SELECT '' AS twenty, b.f1 / p.f1 AS rotation
+SELECT '' AS twenty, b.f1 / p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p
- WHERE (p.f1 <-> '(0,0)'::point) >= 1;
-twenty|rotation
-------+---------------------------------------------------------------------------------
- |(0,-0),(-0.2,-0.2)
- |(-0.1,-0.1),(-0.3,-0.3)
- |(-0.25,-0.25),(-0.25,-0.35)
- |(-0.3,-0.3),(-0.3,-0.3)
- |(0.08,-0),(0,-0.56)
- |(0.12,-0.28),(0.04,-0.84)
- |(0.26,-0.7),(0.1,-0.82)
- |(0.12,-0.84),(0.12,-0.84)
- |(0.0651176557643925,0),(0,-0.0483449262493217)
- |(0.0976764836465887,-0.0241724631246608),(0.0325588278821962,-0.0725173893739825)
- |(0.109762715208919,-0.0562379754328844),(0.0813970697054906,-0.0604311578116521)
- |(0.0976764836465887,-0.0725173893739825),(0.0976764836465887,-0.0725173893739825)
- |(-0,0.0828402366863905),(-0.201183431952663,0)
- |(-0.100591715976331,0.124260355029586),(-0.301775147928994,0.0414201183431953)
- |(-0.251479289940828,0.103550295857988),(-0.322485207100592,0.0739644970414201)
- |(-0.301775147928994,0.124260355029586),(-0.301775147928994,0.124260355029586)
- |(0.2,0),(0,0)
- |(0.3,0),(0.1,0)
- |(0.3,0.05),(0.25,0)
- |(0.3,0),(0.3,0)
+ WHERE (p.f1 <-> point '(0,0)') >= 1;
+ twenty | rotation
+--------+-----------------------------------------------------------------------------------
+ | (0,-0),(-0.2,-0.2)
+ | (-0.1,-0.1),(-0.3,-0.3)
+ | (-0.25,-0.25),(-0.25,-0.35)
+ | (-0.3,-0.3),(-0.3,-0.3)
+ | (0.08,-0),(0,-0.56)
+ | (0.12,-0.28),(0.04,-0.84)
+ | (0.26,-0.7),(0.1,-0.82)
+ | (0.12,-0.84),(0.12,-0.84)
+ | (0.0651176557643925,0),(0,-0.0483449262493217)
+ | (0.0976764836465887,-0.0241724631246608),(0.0325588278821962,-0.0725173893739825)
+ | (0.109762715208919,-0.0562379754328844),(0.0813970697054906,-0.0604311578116521)
+ | (0.0976764836465887,-0.0725173893739825),(0.0976764836465887,-0.0725173893739825)
+ | (-0,0.0828402366863905),(-0.201183431952663,0)
+ | (-0.100591715976331,0.124260355029586),(-0.301775147928994,0.0414201183431953)
+ | (-0.251479289940828,0.103550295857988),(-0.322485207100592,0.0739644970414201)
+ | (-0.301775147928994,0.124260355029586),(-0.301775147928994,0.124260355029586)
+ | (0.2,0),(0,0)
+ | (0.3,0),(0.1,0)
+ | (0.3,0.05),(0.25,0)
+ | (0.3,0),(0.3,0)
(20 rows)
-QUERY: SET geqo TO 'off';
-QUERY: SELECT '' AS eight, points(f1) AS npoints, f1 AS path FROM PATH_TBL;
-eight|npoints|path
------+-------+-------------------------
- | 2|[(1,2),(3,4)]
- | 2|((1,2),(3,4))
- | 4|[(0,0),(3,0),(4,5),(1,6)]
- | 2|((1,2),(3,4))
- | 2|((1,2),(3,4))
- | 2|[(1,2),(3,4)]
- | 2|[(11,12),(13,14)]
- | 2|((11,12),(13,14))
+--
+-- Paths
+--
+SET geqo TO 'off';
+SELECT '' AS eight, points(f1) AS npoints, f1 AS path FROM PATH_TBL;
+ eight | npoints | path
+-------+---------+---------------------------
+ | 2 | [(1,2),(3,4)]
+ | 2 | ((1,2),(3,4))
+ | 4 | [(0,0),(3,0),(4,5),(1,6)]
+ | 2 | ((1,2),(3,4))
+ | 2 | ((1,2),(3,4))
+ | 2 | [(1,2),(3,4)]
+ | 2 | [(11,12),(13,14)]
+ | 2 | ((11,12),(13,14))
(8 rows)
-QUERY: SELECT '' AS four, path(f1) FROM POLYGON_TBL;
-four|path
-----+-------------------
- |((2,0),(2,4),(0,0))
- |((3,1),(3,3),(1,0))
- |((0,0))
- |((0,1),(0,1))
+SELECT '' AS four, path(f1) FROM POLYGON_TBL;
+ four | path
+------+---------------------
+ | ((2,0),(2,4),(0,0))
+ | ((3,1),(3,3),(1,0))
+ | ((0,0))
+ | ((0,1),(0,1))
(4 rows)
-QUERY: SELECT '' AS eight, p1.f1 + '(10,10)'::point AS dist_add
+-- translation
+SELECT '' AS eight, p1.f1 + point '(10,10)' AS dist_add
FROM PATH_TBL p1;
-eight|dist_add
------+---------------------------------
- |[(11,12),(13,14)]
- |((11,12),(13,14))
- |[(10,10),(13,10),(14,15),(11,16)]
- |((11,12),(13,14))
- |((11,12),(13,14))
- |[(11,12),(13,14)]
- |[(21,22),(23,24)]
- |((21,22),(23,24))
+ eight | dist_add
+-------+-----------------------------------
+ | [(11,12),(13,14)]
+ | ((11,12),(13,14))
+ | [(10,10),(13,10),(14,15),(11,16)]
+ | ((11,12),(13,14))
+ | ((11,12),(13,14))
+ | [(11,12),(13,14)]
+ | [(21,22),(23,24)]
+ | ((21,22),(23,24))
(8 rows)
-QUERY: SELECT '' AS eight, p1.f1 * '(2,-1)'::point AS dist_mul
+-- scaling and rotation
+SELECT '' AS eight, p1.f1 * point '(2,-1)' AS dist_mul
FROM PATH_TBL p1;
-eight|dist_mul
------+----------------------------
- |[(4,3),(10,5)]
- |((4,3),(10,5))
- |[(0,0),(6,-3),(13,6),(8,11)]
- |((4,3),(10,5))
- |((4,3),(10,5))
- |[(4,3),(10,5)]
- |[(34,13),(40,15)]
- |((34,13),(40,15))
+ eight | dist_mul
+-------+------------------------------
+ | [(4,3),(10,5)]
+ | ((4,3),(10,5))
+ | [(0,0),(6,-3),(13,6),(8,11)]
+ | ((4,3),(10,5))
+ | ((4,3),(10,5))
+ | [(4,3),(10,5)]
+ | [(34,13),(40,15)]
+ | ((34,13),(40,15))
(8 rows)
-QUERY: RESET geqo;
-QUERY: SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
+RESET geqo;
+--
+-- Polygons
+--
+-- containment
+SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
FROM POLYGON_TBL poly, POINT_TBL p;
-twentyfour|f1 |f1 |contains
-----------+----------+-------------------+--------
- |(0,0) |((2,0),(2,4),(0,0))|t
- |(-10,0) |((2,0),(2,4),(0,0))|f
- |(-3,4) |((2,0),(2,4),(0,0))|f
- |(5.1,34.5)|((2,0),(2,4),(0,0))|f
- |(-5,-12) |((2,0),(2,4),(0,0))|f
- |(10,10) |((2,0),(2,4),(0,0))|f
- |(0,0) |((3,1),(3,3),(1,0))|f
- |(-10,0) |((3,1),(3,3),(1,0))|f
- |(-3,4) |((3,1),(3,3),(1,0))|f
- |(5.1,34.5)|((3,1),(3,3),(1,0))|f
- |(-5,-12) |((3,1),(3,3),(1,0))|f
- |(10,10) |((3,1),(3,3),(1,0))|f
- |(0,0) |((0,0)) |t
- |(-10,0) |((0,0)) |f
- |(-3,4) |((0,0)) |f
- |(5.1,34.5)|((0,0)) |f
- |(-5,-12) |((0,0)) |f
- |(10,10) |((0,0)) |f
- |(0,0) |((0,1),(0,1)) |f
- |(-10,0) |((0,1),(0,1)) |f
- |(-3,4) |((0,1),(0,1)) |f
- |(5.1,34.5)|((0,1),(0,1)) |f
- |(-5,-12) |((0,1),(0,1)) |f
- |(10,10) |((0,1),(0,1)) |f
+ twentyfour | f1 | f1 | contains
+------------+------------+---------------------+----------
+ | (0,0) | ((2,0),(2,4),(0,0)) | t
+ | (-10,0) | ((2,0),(2,4),(0,0)) | f
+ | (-3,4) | ((2,0),(2,4),(0,0)) | f
+ | (5.1,34.5) | ((2,0),(2,4),(0,0)) | f
+ | (-5,-12) | ((2,0),(2,4),(0,0)) | f
+ | (10,10) | ((2,0),(2,4),(0,0)) | f
+ | (0,0) | ((3,1),(3,3),(1,0)) | f
+ | (-10,0) | ((3,1),(3,3),(1,0)) | f
+ | (-3,4) | ((3,1),(3,3),(1,0)) | f
+ | (5.1,34.5) | ((3,1),(3,3),(1,0)) | f
+ | (-5,-12) | ((3,1),(3,3),(1,0)) | f
+ | (10,10) | ((3,1),(3,3),(1,0)) | f
+ | (0,0) | ((0,0)) | t
+ | (-10,0) | ((0,0)) | f
+ | (-3,4) | ((0,0)) | f
+ | (5.1,34.5) | ((0,0)) | f
+ | (-5,-12) | ((0,0)) | f
+ | (10,10) | ((0,0)) | f
+ | (0,0) | ((0,1),(0,1)) | f
+ | (-10,0) | ((0,1),(0,1)) | f
+ | (-3,4) | ((0,1),(0,1)) | f
+ | (5.1,34.5) | ((0,1),(0,1)) | f
+ | (-5,-12) | ((0,1),(0,1)) | f
+ | (10,10) | ((0,1),(0,1)) | f
(24 rows)
-QUERY: SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
+SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
FROM POLYGON_TBL poly, POINT_TBL p;
-twentyfour|f1 |f1 |contained
-----------+----------+-------------------+---------
- |(0,0) |((2,0),(2,4),(0,0))|t
- |(-10,0) |((2,0),(2,4),(0,0))|f
- |(-3,4) |((2,0),(2,4),(0,0))|f
- |(5.1,34.5)|((2,0),(2,4),(0,0))|f
- |(-5,-12) |((2,0),(2,4),(0,0))|f
- |(10,10) |((2,0),(2,4),(0,0))|f
- |(0,0) |((3,1),(3,3),(1,0))|f
- |(-10,0) |((3,1),(3,3),(1,0))|f
- |(-3,4) |((3,1),(3,3),(1,0))|f
- |(5.1,34.5)|((3,1),(3,3),(1,0))|f
- |(-5,-12) |((3,1),(3,3),(1,0))|f
- |(10,10) |((3,1),(3,3),(1,0))|f
- |(0,0) |((0,0)) |t
- |(-10,0) |((0,0)) |f
- |(-3,4) |((0,0)) |f
- |(5.1,34.5)|((0,0)) |f
- |(-5,-12) |((0,0)) |f
- |(10,10) |((0,0)) |f
- |(0,0) |((0,1),(0,1)) |f
- |(-10,0) |((0,1),(0,1)) |f
- |(-3,4) |((0,1),(0,1)) |f
- |(5.1,34.5)|((0,1),(0,1)) |f
- |(-5,-12) |((0,1),(0,1)) |f
- |(10,10) |((0,1),(0,1)) |f
+ twentyfour | f1 | f1 | contained
+------------+------------+---------------------+-----------
+ | (0,0) | ((2,0),(2,4),(0,0)) | t
+ | (-10,0) | ((2,0),(2,4),(0,0)) | f
+ | (-3,4) | ((2,0),(2,4),(0,0)) | f
+ | (5.1,34.5) | ((2,0),(2,4),(0,0)) | f
+ | (-5,-12) | ((2,0),(2,4),(0,0)) | f
+ | (10,10) | ((2,0),(2,4),(0,0)) | f
+ | (0,0) | ((3,1),(3,3),(1,0)) | f
+ | (-10,0) | ((3,1),(3,3),(1,0)) | f
+ | (-3,4) | ((3,1),(3,3),(1,0)) | f
+ | (5.1,34.5) | ((3,1),(3,3),(1,0)) | f
+ | (-5,-12) | ((3,1),(3,3),(1,0)) | f
+ | (10,10) | ((3,1),(3,3),(1,0)) | f
+ | (0,0) | ((0,0)) | t
+ | (-10,0) | ((0,0)) | f
+ | (-3,4) | ((0,0)) | f
+ | (5.1,34.5) | ((0,0)) | f
+ | (-5,-12) | ((0,0)) | f
+ | (10,10) | ((0,0)) | f
+ | (0,0) | ((0,1),(0,1)) | f
+ | (-10,0) | ((0,1),(0,1)) | f
+ | (-3,4) | ((0,1),(0,1)) | f
+ | (5.1,34.5) | ((0,1),(0,1)) | f
+ | (-5,-12) | ((0,1),(0,1)) | f
+ | (10,10) | ((0,1),(0,1)) | f
(24 rows)
-QUERY: SELECT '' AS four, points(f1) AS npoints, f1 AS polygon
+SELECT '' AS four, points(f1) AS npoints, f1 AS polygon
FROM POLYGON_TBL;
-four|npoints|polygon
-----+-------+-------------------
- | 3|((2,0),(2,4),(0,0))
- | 3|((3,1),(3,3),(1,0))
- | 1|((0,0))
- | 2|((0,1),(0,1))
+ four | npoints | polygon
+------+---------+---------------------
+ | 3 | ((2,0),(2,4),(0,0))
+ | 3 | ((3,1),(3,3),(1,0))
+ | 1 | ((0,0))
+ | 2 | ((0,1),(0,1))
(4 rows)
-QUERY: SELECT '' AS four, polygon(f1)
+SELECT '' AS four, polygon(f1)
FROM BOX_TBL;
-four|polygon
-----+-----------------------------------------
- |((0,0),(0,2),(2,2),(2,0))
- |((1,1),(1,3),(3,3),(3,1))
- |((2.5,2.5),(2.5,3.5),(2.5,3.5),(2.5,2.5))
- |((3,3),(3,3),(3,3),(3,3))
+ four | polygon
+------+-------------------------------------------
+ | ((0,0),(0,2),(2,2),(2,0))
+ | ((1,1),(1,3),(3,3),(3,1))
+ | ((2.5,2.5),(2.5,3.5),(2.5,3.5),(2.5,2.5))
+ | ((3,3),(3,3),(3,3),(3,3))
(4 rows)
-QUERY: SELECT '' AS four, polygon(f1)
+SELECT '' AS four, polygon(f1)
FROM PATH_TBL WHERE isclosed(f1);
-four|polygon
-----+-----------------
- |((1,2),(3,4))
- |((1,2),(3,4))
- |((1,2),(3,4))
- |((11,12),(13,14))
+ four | polygon
+------+-------------------
+ | ((1,2),(3,4))
+ | ((1,2),(3,4))
+ | ((1,2),(3,4))
+ | ((11,12),(13,14))
(4 rows)
-QUERY: SELECT '' AS four, f1 AS open_path, polygon( pclose(f1)) AS polygon
+SELECT '' AS four, f1 AS open_path, polygon( pclose(f1)) AS polygon
FROM PATH_TBL
WHERE isopen(f1);
-four|open_path |polygon
-----+-------------------------+-------------------------
- |[(1,2),(3,4)] |((1,2),(3,4))
- |[(0,0),(3,0),(4,5),(1,6)]|((0,0),(3,0),(4,5),(1,6))
- |[(1,2),(3,4)] |((1,2),(3,4))
- |[(11,12),(13,14)] |((11,12),(13,14))
+ four | open_path | polygon
+------+---------------------------+---------------------------
+ | [(1,2),(3,4)] | ((1,2),(3,4))
+ | [(0,0),(3,0),(4,5),(1,6)] | ((0,0),(3,0),(4,5),(1,6))
+ | [(1,2),(3,4)] | ((1,2),(3,4))
+ | [(11,12),(13,14)] | ((11,12),(13,14))
(4 rows)
-QUERY: SELECT '' AS six, polygon(f1)
+-- convert circles to polygons using the default number of points
+SELECT '' AS six, polygon(f1)
FROM CIRCLE_TBL;
-six|polygon
----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- |((-3,0),(-2.59807621135332,1.5),(-1.5,2.59807621135332),(-1.83690953073357e-16,3),(1.5,2.59807621135332),(2.59807621135332,1.5),(3,3.67381906146713e-16),(2.59807621135332,-1.5),(1.5,-2.59807621135332),(5.5107285922007e-16,-3),(-1.5,-2.59807621135332),(-2.59807621135332,-1.5))
- |((-99,2),(-85.6025403784439,52),(-49,88.6025403784439),(0.999999999999994,102),(51,88.6025403784439),(87.6025403784439,52),(101,2.00000000000001),(87.6025403784439,-48),(51,-84.6025403784438),(1.00000000000002,-98),(-49,-84.6025403784439),(-85.6025403784438,-48))
- |((-4,3),(-3.33012701892219,5.5),(-1.5,7.33012701892219),(1,8),(3.5,7.33012701892219),(5.33012701892219,5.5),(6,3),(5.33012701892219,0.500000000000001),(3.5,-1.33012701892219),(1,-2),(-1.5,-1.33012701892219),(-3.33012701892219,0.499999999999998))
- |((-2,2),(-1.59807621135332,3.5),(-0.5,4.59807621135332),(1,5),(2.5,4.59807621135332),(3.59807621135332,3.5),(4,2),(3.59807621135332,0.500000000000001),(2.5,-0.598076211353315),(1,-1),(-0.5,-0.598076211353316),(-1.59807621135332,0.499999999999999))
- |((90,200),(91.3397459621556,205),(95,208.660254037844),(100,210),(105,208.660254037844),(108.660254037844,205),(110,200),(108.660254037844,195),(105,191.339745962156),(100,190),(95,191.339745962156),(91.3397459621556,195))
- |((0,0),(13.3974596215561,50),(50,86.6025403784439),(100,100),(150,86.6025403784439),(186.602540378444,50),(200,1.22460635382238e-14),(186.602540378444,-50),(150,-86.6025403784438),(100,-100),(50,-86.6025403784439),(13.3974596215562,-50))
+ six | polygon
+-----+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ | ((-3,0),(-2.59807621135076,1.50000000000442),(-1.49999999999116,2.59807621135842),(1.53102359078377e-11,3),(1.50000000001768,2.59807621134311),(2.59807621136607,1.4999999999779),(3,-3.06204718156754e-11),(2.59807621133545,-1.50000000003094),(1.49999999996464,-2.59807621137373),(-4.59307077235131e-11,-3),(-1.5000000000442,-2.5980762113278),(-2.59807621138138,-1.49999999995138))
+ | ((-99,2),(-85.6025403783588,52.0000000001473),(-48.9999999997054,88.602540378614),(1.00000000051034,102),(51.0000000005893,88.6025403781036),(87.6025403788692,51.9999999992634),(101,1.99999999897932),(87.6025403778485,-48.0000000010313),(50.9999999988214,-84.6025403791243),(0.999999998468976,-98),(-49.0000000014732,-84.6025403775933),(-85.6025403793795,-47.9999999983795))
+ | ((-4,3),(-3.33012701891794,5.50000000000737),(-1.49999999998527,7.3301270189307),(1.00000000002552,8),(3.50000000002946,7.33012701890518),(5.33012701894346,5.49999999996317),(6,2.99999999994897),(5.33012701889242,0.499999999948437),(3.49999999994107,-1.33012701895622),(0.999999999923449,-2),(-1.50000000007366,-1.33012701887966),(-3.33012701896897,0.500000000081028))
+ | ((-2,2),(-1.59807621135076,3.50000000000442),(-0.499999999991161,4.59807621135842),(1.00000000001531,5),(2.50000000001768,4.59807621134311),(3.59807621136607,3.4999999999779),(4,1.99999999996938),(3.59807621133545,0.499999999969062),(2.49999999996464,-0.59807621137373),(0.999999999954069,-1),(-0.500000000044197,-0.598076211327799),(-1.59807621138138,0.500000000048617))
+ | ((90,200),(91.3397459621641,205.000000000015),(95.0000000000295,208.660254037861),(100.000000000051,210),(105.000000000059,208.66025403781),(108.660254037887,204.999999999926),(110,199.999999999898),(108.660254037785,194.999999999897),(104.999999999882,191.339745962088),(99.9999999998469,190),(94.9999999998527,191.339745962241),(91.3397459620621,195.000000000162))
+ | ((0,0),(13.3974596216412,50.0000000001473),(50.0000000002946,86.602540378614),(100.00000000051,100),(150.000000000589,86.6025403781036),(186.602540378869,49.9999999992634),(200,-1.02068239385585e-09),(186.602540377848,-50.0000000010313),(149.999999998821,-86.6025403791243),(99.999999998469,-100),(49.9999999985268,-86.6025403775933),(13.3974596206205,-49.9999999983795))
(6 rows)
-QUERY: SELECT '' AS six, polygon(8, f1)
+-- convert the circle to an 8-point polygon
+SELECT '' AS six, polygon(8, f1)
FROM CIRCLE_TBL;
-six|polygon
----+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- |((-3,0),(-2.12132034355964,2.12132034355964),(-1.83690953073357e-16,3),(2.12132034355964,2.12132034355964),(3,3.67381906146713e-16),(2.12132034355964,-2.12132034355964),(5.5107285922007e-16,-3),(-2.12132034355964,-2.12132034355964))
- |((-99,2),(-69.7106781186548,72.7106781186548),(0.999999999999994,102),(71.7106781186547,72.7106781186548),(101,2.00000000000001),(71.7106781186548,-68.7106781186547),(1.00000000000002,-98),(-69.7106781186547,-68.7106781186548))
- |((-4,3),(-2.53553390593274,6.53553390593274),(1,8),(4.53553390593274,6.53553390593274),(6,3),(4.53553390593274,-0.535533905932737),(1,-2),(-2.53553390593274,-0.535533905932738))
- |((-2,2),(-1.12132034355964,4.12132034355964),(1,5),(3.12132034355964,4.12132034355964),(4,2),(3.12132034355964,-0.121320343559642),(1,-1),(-1.12132034355964,-0.121320343559643))
- |((90,200),(92.9289321881345,207.071067811865),(100,210),(107.071067811865,207.071067811865),(110,200),(107.071067811865,192.928932188135),(100,190),(92.9289321881345,192.928932188135))
- |((0,0),(29.2893218813452,70.7106781186548),(100,100),(170.710678118655,70.7106781186548),(200,1.22460635382238e-14),(170.710678118655,-70.7106781186547),(100,-100),(29.2893218813453,-70.7106781186548))
+ six | polygon
+-----+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ | ((-3,0),(-2.12132034355423,2.12132034356506),(1.53102359078377e-11,3),(2.12132034357588,2.1213203435434),(3,-3.06204718156754e-11),(2.12132034353258,-2.12132034358671),(-4.59307077235131e-11,-3),(-2.12132034359753,-2.12132034352175))
+ | ((-99,2),(-69.7106781184743,72.7106781188352),(1.00000000051034,102),(71.710678119196,72.7106781181134),(101,1.99999999897932),(71.7106781177526,-68.7106781195569),(0.999999998468976,-98),(-69.7106781199178,-68.7106781173917))
+ | ((-4,3),(-2.53553390592372,6.53553390594176),(1.00000000002552,8),(4.5355339059598,6.53553390590567),(6,2.99999999994897),(4.53553390588763,-0.535533905977846),(0.999999999923449,-2),(-2.53553390599589,-0.535533905869586))
+ | ((-2,2),(-1.12132034355423,4.12132034356506),(1.00000000001531,5),(3.12132034357588,4.1213203435434),(4,1.99999999996938),(3.12132034353258,-0.121320343586707),(0.999999999954069,-1),(-1.12132034359753,-0.121320343521752))
+ | ((90,200),(92.9289321881526,207.071067811884),(100.000000000051,210),(107.07106781192,207.071067811811),(110,199.999999999898),(107.071067811775,192.928932188044),(99.9999999998469,190),(92.9289321880082,192.928932188261))
+ | ((0,0),(29.2893218815257,70.7106781188352),(100.00000000051,100),(170.710678119196,70.7106781181134),(200,-1.02068239385585e-09),(170.710678117753,-70.7106781195569),(99.999999998469,-100),(29.2893218800822,-70.7106781173917))
(6 rows)
-QUERY: SELECT '' AS six, circle(f1, 50.0)
+--
+-- Circles
+--
+SELECT '' AS six, circle(f1, 50.0)
FROM POINT_TBL;
-six|circle
----+---------------
- |<(0,0),50>
- |<(-10,0),50>
- |<(-3,4),50>
- |<(5.1,34.5),50>
- |<(-5,-12),50>
- |<(10,10),50>
+ six | circle
+-----+-----------------
+ | <(0,0),50>
+ | <(-10,0),50>
+ | <(-3,4),50>
+ | <(5.1,34.5),50>
+ | <(-5,-12),50>
+ | <(10,10),50>
(6 rows)
-QUERY: SELECT '' AS four, circle(f1)
+SELECT '' AS four, circle(f1)
FROM BOX_TBL;
-four|circle
-----+-----------------------
- |<(1,1),1.4142135623731>
- |<(2,2),1.4142135623731>
- |<(2.5,3),0.5>
- |<(3,3),0>
+ four | circle
+------+-------------------------
+ | <(1,1),1.4142135623731>
+ | <(2,2),1.4142135623731>
+ | <(2.5,3),0.5>
+ | <(3,3),0>
(4 rows)
-QUERY: SELECT '' AS two, circle(f1)
+SELECT '' AS two, circle(f1)
FROM POLYGON_TBL
WHERE (# f1) >= 3;
-two|circle
----+------------------------------------------------------
- |<(1.33333333333333,1.33333333333333),2.04168905063636>
- |<(2.33333333333333,1.33333333333333),1.47534300379185>
+ two | circle
+-----+--------------------------------------------------------
+ | <(1.33333333333333,1.33333333333333),2.04168905063636>
+ | <(2.33333333333333,1.33333333333333),1.47534300379185>
(2 rows)
-QUERY: SELECT '' AS twentyfour, c1.f1 AS circle, p1.f1 AS point, (p1.f1 <-> c1.f1) AS distance
+SELECT '' AS twentyfour, c1.f1 AS circle, p1.f1 AS point, (p1.f1 <-> c1.f1) AS distance
FROM CIRCLE_TBL c1, POINT_TBL p1
WHERE (p1.f1 <-> c1.f1) > 0
ORDER BY distance, circle, point using <<;
-twentyfour|circle |point | distance
-----------+--------------+----------+-----------------
- |<(100,0),100> |(5.1,34.5)|0.976531926977964
- |<(1,2),3> |(-3,4) | 1.47213595499958
- |<(0,0),3> |(-3,4) | 2
- |<(100,0),100> |(-3,4) | 3.07764064044151
- |<(100,0),100> |(-5,-12) | 5.68348972285122
- |<(1,3),5> |(-10,0) | 6.40175425099138
- |<(1,3),5> |(10,10) | 6.40175425099138
- |<(0,0),3> |(-10,0) | 7
- |<(1,2),3> |(-10,0) | 8.18033988749895
- |<(1,2),3> |(10,10) | 9.0415945787923
- |<(0,0),3> |(-5,-12) | 10
- |<(100,0),100> |(-10,0) | 10
- |<(0,0),3> |(10,10) | 11.142135623731
- |<(1,3),5> |(-5,-12) | 11.1554944214035
- |<(1,2),3> |(-5,-12) | 12.2315462117278
- |<(1,3),5> |(5.1,34.5)| 26.7657047773224
- |<(1,2),3> |(5.1,34.5)| 29.757594539282
- |<(0,0),3> |(5.1,34.5)| 31.8749193547455
- |<(100,200),10>|(5.1,34.5)| 180.778038568384
- |<(100,200),10>|(10,10) | 200.237960416286
- |<(100,200),10>|(-3,4) | 211.415898254845
- |<(100,200),10>|(0,0) | 213.606797749979
- |<(100,200),10>|(-10,0) | 218.254244210267
- |<(100,200),10>|(-5,-12) | 226.577682802077
+ twentyfour | circle | point | distance
+------------+----------------+------------+------------------
+ | <(100,0),100> | (5.1,34.5) | 0.97653192697797
+ | <(1,2),3> | (-3,4) | 1.47213595499958
+ | <(0,0),3> | (-3,4) | 2
+ | <(100,0),100> | (-3,4) | 3.07764064044152
+ | <(100,0),100> | (-5,-12) | 5.68348972285122
+ | <(1,3),5> | (-10,0) | 6.40175425099138
+ | <(1,3),5> | (10,10) | 6.40175425099138
+ | <(0,0),3> | (-10,0) | 7
+ | <(1,2),3> | (-10,0) | 8.18033988749895
+ | <(1,2),3> | (10,10) | 9.0415945787923
+ | <(0,0),3> | (-5,-12) | 10
+ | <(100,0),100> | (-10,0) | 10
+ | <(0,0),3> | (10,10) | 11.142135623731
+ | <(1,3),5> | (-5,-12) | 11.1554944214035
+ | <(1,2),3> | (-5,-12) | 12.2315462117278
+ | <(1,3),5> | (5.1,34.5) | 26.7657047773223
+ | <(1,2),3> | (5.1,34.5) | 29.757594539282
+ | <(0,0),3> | (5.1,34.5) | 31.8749193547455
+ | <(100,200),10> | (5.1,34.5) | 180.778038568384
+ | <(100,200),10> | (10,10) | 200.237960416286
+ | <(100,200),10> | (-3,4) | 211.415898254845
+ | <(100,200),10> | (0,0) | 213.606797749979
+ | <(100,200),10> | (-10,0) | 218.254244210267
+ | <(100,200),10> | (-5,-12) | 226.577682802077
(24 rows)
-QUERY: CREATE TABLE TEMP_DATETIME (f1 datetime);
-QUERY: INSERT INTO TEMP_DATETIME (f1)
+--
+-- HOROLOGY
+--
+--
+-- datetime, timespan arithmetic
+--
+SELECT datetime '1996-03-01' - timespan '1 second' AS "Feb 29";
+ Feb 29
+------------------------------
+ Thu Feb 29 23:59:59 1996 PST
+(1 row)
+
+SELECT datetime '1999-03-01' - timespan '1 second' AS "Feb 28";
+ Feb 28
+------------------------------
+ Sun Feb 28 23:59:59 1999 PST
+(1 row)
+
+SELECT datetime '2000-03-01' - timespan '1 second' AS "Feb 29";
+ Feb 29
+------------------------------
+ Tue Feb 29 23:59:59 2000 PST
+(1 row)
+
+SELECT datetime '1999-12-01' + timespan '1 month - 1 second' AS "Dec 31";
+ Dec 31
+------------------------------
+ Fri Dec 31 23:59:59 1999 PST
+(1 row)
+
+CREATE TABLE TEMP_DATETIME (f1 datetime);
+-- get some candidate input values
+INSERT INTO TEMP_DATETIME (f1)
SELECT d1 FROM DATETIME_TBL
WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
-QUERY: SELECT '' AS ten, f1 AS datetime
+SELECT '' AS ten, f1 AS datetime
FROM TEMP_DATETIME
ORDER BY datetime;
-ten|datetime
----+----------------------------
- |epoch
- |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
- |Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST
+ ten | datetime
+-----+------------------------------
+ | epoch
+ | 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
+ | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST
(10 rows)
-QUERY: SELECT '' AS hundred, d.f1 AS datetime, t.f1 AS timespan, d.f1 + t.f1 AS plus
+SELECT '' AS hundred, d.f1 AS datetime, t.f1 AS timespan, d.f1 + t.f1 AS plus
FROM TEMP_DATETIME d, TIMESPAN_TBL t
ORDER BY plus, datetime, timespan;
-hundred|datetime |timespan |plus
--------+----------------------------+-----------------------------+----------------------------
- |epoch |@ 14 secs ago |Wed Dec 31 15:59:46 1969 PST
- |epoch |@ 1 min |Wed Dec 31 16:01:00 1969 PST
- |epoch |@ 5 hours |Wed Dec 31 21:00:00 1969 PST
- |epoch |@ 1 day 2 hours 3 mins 4 secs|Thu Jan 01 18:03:04 1970 PST
- |epoch |@ 10 days |Sat Jan 10 16:00:00 1970 PST
- |epoch |@ 3 mons |Tue Mar 31 16:00:00 1970 PST
- |epoch |@ 5 mons |Sun May 31 17:00:00 1970 PDT
- |epoch |@ 5 mons 12 hours |Mon Jun 01 05:00:00 1970 PDT
- |epoch |@ 6 years |Wed Dec 31 16:00:00 1975 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 18:32:01 1996 PDT
- |Thu Feb 29 17:32:01 1996 PST|@ 3 mons |Wed May 29 18:32:01 1996 PDT
- |Fri Mar 01 17:32:01 1996 PST|@ 3 mons |Sat Jun 01 18:32:01 1996 PDT
- |Wed Feb 28 17:32:01 1996 PST|@ 5 mons |Sun Jul 28 18:32:01 1996 PDT
- |Wed Feb 28 17:32:01 1996 PST|@ 5 mons 12 hours |Mon Jul 29 06:32:01 1996 PDT
- |Thu Feb 29 17:32:01 1996 PST|@ 5 mons |Mon Jul 29 18:32:01 1996 PDT
- |Thu Feb 29 17:32:01 1996 PST|@ 5 mons 12 hours |Thu Aug 01 06:32:01 1996 PDT
- |Fri Mar 01 17:32:01 1996 PST|@ 5 mons |Thu Aug 01 18:32:01 1996 PDT
- |Fri Mar 01 17:32:01 1996 PST|@ 5 mons 12 hours |Fri Aug 02 06: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 18:32:01 1997 PDT
- |Mon Dec 30 17:32:01 1996 PST|@ 5 mons 12 hours |Sat May 31 06:32:01 1997 PDT
- |Tue Dec 31 17:32:01 1996 PST|@ 5 mons |Sat May 31 18:32:01 1997 PDT
- |Tue Dec 31 17:32:01 1996 PST|@ 5 mons 12 hours |Sun Jun 01 06: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
- |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 18:32:01 2000 PDT
- |Fri Dec 31 17:32:01 1999 PST|@ 5 mons 12 hours |Thu Jun 01 06:32:01 2000 PDT
- |Sat Jan 01 17:32:01 2000 PST|@ 5 mons |Thu Jun 01 18:32:01 2000 PDT
- |Sat Jan 01 17:32:01 2000 PST|@ 5 mons 12 hours |Fri Jun 02 06:32:01 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 18:32:01 2001 PDT
- |Sun Dec 31 17:32:01 2000 PST|@ 5 mons |Thu May 31 18:32:01 2001 PDT
- |Sun Dec 31 17:32:01 2000 PST|@ 5 mons 12 hours |Fri Jun 01 06:32:01 2001 PDT
- |Mon Jan 01 17:32:01 2001 PST|@ 5 mons |Fri Jun 01 18:32:01 2001 PDT
- |Mon Jan 01 17:32:01 2001 PST|@ 5 mons 12 hours |Sat Jun 02 06:32:01 2001 PDT
- |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
- |epoch |@ 34 years |Wed Dec 31 16:00:00 2003 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
- |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
- |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
- |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
+ hundred | datetime | timespan | plus
+---------+------------------------------+-------------------------------+------------------------------
+ | epoch | @ 14 secs ago | Wed Dec 31 15:59:46 1969 PST
+ | epoch | @ 1 min | Wed Dec 31 16:01:00 1969 PST
+ | epoch | @ 5 hours | Wed Dec 31 21:00:00 1969 PST
+ | epoch | @ 1 day 2 hours 3 mins 4 secs | Thu Jan 01 18:03:04 1970 PST
+ | epoch | @ 10 days | Sat Jan 10 16:00:00 1970 PST
+ | epoch | @ 3 mons | Tue Mar 31 16:00:00 1970 PST
+ | epoch | @ 5 mons | Sun May 31 17:00:00 1970 PDT
+ | epoch | @ 5 mons 12 hours | Mon Jun 01 05:00:00 1970 PDT
+ | epoch | @ 6 years | Wed Dec 31 16:00:00 1975 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 18:32:01 1996 PDT
+ | Thu Feb 29 17:32:01 1996 PST | @ 3 mons | Wed May 29 18:32:01 1996 PDT
+ | Fri Mar 01 17:32:01 1996 PST | @ 3 mons | Sat Jun 01 18:32:01 1996 PDT
+ | Wed Feb 28 17:32:01 1996 PST | @ 5 mons | Sun Jul 28 18:32:01 1996 PDT
+ | Wed Feb 28 17:32:01 1996 PST | @ 5 mons 12 hours | Mon Jul 29 06:32:01 1996 PDT
+ | Thu Feb 29 17:32:01 1996 PST | @ 5 mons | Mon Jul 29 18:32:01 1996 PDT
+ | Thu Feb 29 17:32:01 1996 PST | @ 5 mons 12 hours | Tue Jul 30 06:32:01 1996 PDT
+ | Fri Mar 01 17:32:01 1996 PST | @ 5 mons | Thu Aug 01 18:32:01 1996 PDT
+ | Fri Mar 01 17:32:01 1996 PST | @ 5 mons 12 hours | Fri Aug 02 06: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 18:32:01 1997 PDT
+ | Mon Dec 30 17:32:01 1996 PST | @ 5 mons 12 hours | Sat May 31 06:32:01 1997 PDT
+ | Tue Dec 31 17:32:01 1996 PST | @ 5 mons | Sat May 31 18:32:01 1997 PDT
+ | Tue Dec 31 17:32:01 1996 PST | @ 5 mons 12 hours | Sun Jun 01 06: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
+ | 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 18:32:01 2000 PDT
+ | Fri Dec 31 17:32:01 1999 PST | @ 5 mons 12 hours | Thu Jun 01 06:32:01 2000 PDT
+ | Sat Jan 01 17:32:01 2000 PST | @ 5 mons | Thu Jun 01 18:32:01 2000 PDT
+ | Sat Jan 01 17:32:01 2000 PST | @ 5 mons 12 hours | Fri Jun 02 06:32:01 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 18:32:01 2001 PDT
+ | Sun Dec 31 17:32:01 2000 PST | @ 5 mons | Thu May 31 18:32:01 2001 PDT
+ | Sun Dec 31 17:32:01 2000 PST | @ 5 mons 12 hours | Fri Jun 01 06:32:01 2001 PDT
+ | Mon Jan 01 17:32:01 2001 PST | @ 5 mons | Fri Jun 01 18:32:01 2001 PDT
+ | Mon Jan 01 17:32:01 2001 PST | @ 5 mons 12 hours | Sat Jun 02 06:32:01 2001 PDT
+ | 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
+ | epoch | @ 34 years | Wed Dec 31 16:00:00 2003 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
+ | 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
+ | 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
+ | 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
(100 rows)
-QUERY: SELECT '' AS hundred, d.f1 AS datetime, t.f1 AS timespan, d.f1 - t.f1 AS minus
+SELECT '' AS hundred, d.f1 AS datetime, t.f1 AS timespan, d.f1 - t.f1 AS minus
FROM TEMP_DATETIME d, TIMESPAN_TBL t
WHERE isfinite(d.f1)
ORDER BY minus, datetime, timespan;
-hundred|datetime |timespan |minus
--------+----------------------------+-----------------------------+----------------------------
- |epoch |@ 34 years |Tue Dec 31 16:00:00 1935 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
- |epoch |@ 6 years |Tue Dec 31 16:00:00 1963 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
- |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
- |epoch |@ 5 mons 12 hours |Thu Jul 31 05:00:00 1969 PDT
- |epoch |@ 5 mons |Thu Jul 31 17:00:00 1969 PDT
- |epoch |@ 3 mons |Tue Sep 30 17:00:00 1969 PDT
- |epoch |@ 10 days |Sun Dec 21 16:00:00 1969 PST
- |epoch |@ 1 day 2 hours 3 mins 4 secs|Tue Dec 30 13:56:56 1969 PST
- |epoch |@ 5 hours |Wed Dec 31 11:00:00 1969 PST
- |epoch |@ 1 min |Wed Dec 31 15:59:00 1969 PST
- |epoch |@ 14 secs ago |Wed Dec 31 16:00:14 1969 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
- |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
- |Wed Feb 28 17:32:01 1996 PST|@ 5 mons 12 hours |Thu Sep 28 06:32:01 1995 PDT
- |Wed Feb 28 17:32:01 1996 PST|@ 5 mons |Thu Sep 28 18:32:01 1995 PDT
- |Thu Feb 29 17:32:01 1996 PST|@ 5 mons 12 hours |Fri Sep 29 06:32:01 1995 PDT
- |Thu Feb 29 17:32:01 1996 PST|@ 5 mons |Fri Sep 29 18:32:01 1995 PDT
- |Fri Mar 01 17:32:01 1996 PST|@ 5 mons 12 hours |Sun Oct 01 06:32:01 1995 PDT
- |Fri Mar 01 17:32:01 1996 PST|@ 5 mons |Sun Oct 01 18: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 06:32:01 1996 PDT
- |Mon Dec 30 17:32:01 1996 PST|@ 5 mons |Tue Jul 30 18:32:01 1996 PDT
- |Tue Dec 31 17:32:01 1996 PST|@ 5 mons 12 hours |Wed Jul 31 06:32:01 1996 PDT
- |Tue Dec 31 17:32:01 1996 PST|@ 5 mons |Wed Jul 31 18:32:01 1996 PDT
- |Mon Dec 30 17:32:01 1996 PST|@ 3 mons |Mon Sep 30 18:32:01 1996 PDT
- |Tue Dec 31 17:32:01 1996 PST|@ 3 mons |Mon Sep 30 18: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 06:32:01 1999 PDT
- |Fri Dec 31 17:32:01 1999 PST|@ 5 mons |Sat Jul 31 18:32:01 1999 PDT
- |Sat Jan 01 17:32:01 2000 PST|@ 5 mons 12 hours |Sun Aug 01 06:32:01 1999 PDT
- |Sat Jan 01 17:32:01 2000 PST|@ 5 mons |Sun Aug 01 18:32:01 1999 PDT
- |Fri Dec 31 17:32:01 1999 PST|@ 3 mons |Thu Sep 30 18:32:01 1999 PDT
- |Sat Jan 01 17:32:01 2000 PST|@ 3 mons |Fri Oct 01 18:32:01 1999 PDT
- |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
- |Sun Dec 31 17:32:01 2000 PST|@ 5 mons 12 hours |Mon Jul 31 06:32:01 2000 PDT
- |Sun Dec 31 17:32:01 2000 PST|@ 5 mons |Mon Jul 31 18:32:01 2000 PDT
- |Mon Jan 01 17:32:01 2001 PST|@ 5 mons 12 hours |Tue Aug 01 06:32:01 2000 PDT
- |Mon Jan 01 17:32:01 2001 PST|@ 5 mons |Tue Aug 01 18:32:01 2000 PDT
- |Sun Dec 31 17:32:01 2000 PST|@ 3 mons |Sat Sep 30 18:32:01 2000 PDT
- |Mon Jan 01 17:32:01 2001 PST|@ 3 mons |Sun Oct 01 18: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
+ hundred | datetime | timespan | minus
+---------+------------------------------+-------------------------------+------------------------------
+ | epoch | @ 34 years | Tue Dec 31 16:00:00 1935 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
+ | epoch | @ 6 years | Tue Dec 31 16:00:00 1963 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
+ | 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
+ | epoch | @ 5 mons 12 hours | Thu Jul 31 05:00:00 1969 PDT
+ | epoch | @ 5 mons | Thu Jul 31 17:00:00 1969 PDT
+ | epoch | @ 3 mons | Tue Sep 30 17:00:00 1969 PDT
+ | epoch | @ 10 days | Sun Dec 21 16:00:00 1969 PST
+ | epoch | @ 1 day 2 hours 3 mins 4 secs | Tue Dec 30 13:56:56 1969 PST
+ | epoch | @ 5 hours | Wed Dec 31 11:00:00 1969 PST
+ | epoch | @ 1 min | Wed Dec 31 15:59:00 1969 PST
+ | epoch | @ 14 secs ago | Wed Dec 31 16:00:14 1969 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
+ | 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
+ | Wed Feb 28 17:32:01 1996 PST | @ 5 mons 12 hours | Thu Sep 28 06:32:01 1995 PDT
+ | Wed Feb 28 17:32:01 1996 PST | @ 5 mons | Thu Sep 28 18:32:01 1995 PDT
+ | Thu Feb 29 17:32:01 1996 PST | @ 5 mons 12 hours | Fri Sep 29 06:32:01 1995 PDT
+ | Thu Feb 29 17:32:01 1996 PST | @ 5 mons | Fri Sep 29 18:32:01 1995 PDT
+ | Fri Mar 01 17:32:01 1996 PST | @ 5 mons 12 hours | Sun Oct 01 06:32:01 1995 PDT
+ | Fri Mar 01 17:32:01 1996 PST | @ 5 mons | Sun Oct 01 18: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 06:32:01 1996 PDT
+ | Mon Dec 30 17:32:01 1996 PST | @ 5 mons | Tue Jul 30 18:32:01 1996 PDT
+ | Tue Dec 31 17:32:01 1996 PST | @ 5 mons 12 hours | Wed Jul 31 06:32:01 1996 PDT
+ | Tue Dec 31 17:32:01 1996 PST | @ 5 mons | Wed Jul 31 18:32:01 1996 PDT
+ | Mon Dec 30 17:32:01 1996 PST | @ 3 mons | Mon Sep 30 18:32:01 1996 PDT
+ | Tue Dec 31 17:32:01 1996 PST | @ 3 mons | Mon Sep 30 18: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 06:32:01 1999 PDT
+ | Fri Dec 31 17:32:01 1999 PST | @ 5 mons | Sat Jul 31 18:32:01 1999 PDT
+ | Sat Jan 01 17:32:01 2000 PST | @ 5 mons 12 hours | Sun Aug 01 06:32:01 1999 PDT
+ | Sat Jan 01 17:32:01 2000 PST | @ 5 mons | Sun Aug 01 18:32:01 1999 PDT
+ | Fri Dec 31 17:32:01 1999 PST | @ 3 mons | Thu Sep 30 18:32:01 1999 PDT
+ | Sat Jan 01 17:32:01 2000 PST | @ 3 mons | Fri Oct 01 18:32:01 1999 PDT
+ | 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
+ | Sun Dec 31 17:32:01 2000 PST | @ 5 mons 12 hours | Mon Jul 31 06:32:01 2000 PDT
+ | Sun Dec 31 17:32:01 2000 PST | @ 5 mons | Mon Jul 31 18:32:01 2000 PDT
+ | Mon Jan 01 17:32:01 2001 PST | @ 5 mons 12 hours | Tue Aug 01 06:32:01 2000 PDT
+ | Mon Jan 01 17:32:01 2001 PST | @ 5 mons | Tue Aug 01 18:32:01 2000 PDT
+ | Sun Dec 31 17:32:01 2000 PST | @ 3 mons | Sat Sep 30 18:32:01 2000 PDT
+ | Mon Jan 01 17:32:01 2001 PST | @ 3 mons | Sun Oct 01 18: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
(100 rows)
-QUERY: SELECT '' AS ten, d.f1 AS datetime, '1980-01-06 00:00 GMT'::datetime AS gpstime_zero,
- d.f1 - '1980-01-06 00:00 GMT'::datetime AS difference
+SELECT '' AS ten, d.f1 AS datetime, datetime '1980-01-06 00:00 GMT' AS gpstime_zero,
+ d.f1 - datetime '1980-01-06 00:00 GMT' AS difference
FROM TEMP_DATETIME d
ORDER BY difference;
-ten|datetime |gpstime_zero |difference
----+----------------------------+----------------------------+--------------------------------
- |epoch |Sat Jan 05 16:00:00 1980 PST|@ 3657 days 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
- |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
+ ten | datetime | gpstime_zero | difference
+-----+------------------------------+------------------------------+----------------------------------
+ | epoch | Sat Jan 05 16:00:00 1980 PST | @ 3657 days 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
+ | 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
(10 rows)
-QUERY: SELECT '' AS hundred, d1.f1 AS datetime1, d2.f1 AS datetime2, d1.f1 - d2.f1 AS difference
+SELECT '' AS hundred, d1.f1 AS datetime1, d2.f1 AS datetime2, d1.f1 - d2.f1 AS difference
FROM TEMP_DATETIME d1, TEMP_DATETIME d2
ORDER BY datetime1, datetime2, difference;
-hundred|datetime1 |datetime2 |difference
--------+----------------------------+----------------------------+-------------------------------------
- |epoch |epoch |@ 0
- |epoch |Wed Feb 28 17:32:01 1996 PST|@ 9555 days 1 hour 32 mins 1 sec ago
- |epoch |Thu Feb 29 17:32:01 1996 PST|@ 9556 days 1 hour 32 mins 1 sec ago
- |epoch |Fri Mar 01 17:32:01 1996 PST|@ 9557 days 1 hour 32 mins 1 sec ago
- |epoch |Mon Dec 30 17:32:01 1996 PST|@ 9861 days 1 hour 32 mins 1 sec ago
- |epoch |Tue Dec 31 17:32:01 1996 PST|@ 9862 days 1 hour 32 mins 1 sec ago
- |epoch |Fri Dec 31 17:32:01 1999 PST|@ 10957 days 1 hour 32 mins 1 sec ago
- |epoch |Sat Jan 01 17:32:01 2000 PST|@ 10958 days 1 hour 32 mins 1 sec ago
- |epoch |Sun Dec 31 17:32:01 2000 PST|@ 11323 days 1 hour 32 mins 1 sec ago
- |epoch |Mon Jan 01 17:32:01 2001 PST|@ 11324 days 1 hour 32 mins 1 sec ago
- |Wed Feb 28 17:32:01 1996 PST|epoch |@ 9555 days 1 hour 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|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
- |Thu Feb 29 17:32:01 1996 PST|epoch |@ 9556 days 1 hour 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|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
- |Fri Mar 01 17:32:01 1996 PST|epoch |@ 9557 days 1 hour 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|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
- |Mon Dec 30 17:32:01 1996 PST|epoch |@ 9861 days 1 hour 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|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
- |Tue Dec 31 17:32:01 1996 PST|epoch |@ 9862 days 1 hour 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|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
- |Fri Dec 31 17:32:01 1999 PST|epoch |@ 10957 days 1 hour 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|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
- |Sat Jan 01 17:32:01 2000 PST|epoch |@ 10958 days 1 hour 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|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
- |Sun Dec 31 17:32:01 2000 PST|epoch |@ 11323 days 1 hour 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|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
- |Mon Jan 01 17:32:01 2001 PST|epoch |@ 11324 days 1 hour 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|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
+ hundred | datetime1 | datetime2 | difference
+---------+------------------------------+------------------------------+---------------------------------------
+ | epoch | epoch | @ 0
+ | epoch | Wed Feb 28 17:32:01 1996 PST | @ 9555 days 1 hour 32 mins 1 sec ago
+ | epoch | Thu Feb 29 17:32:01 1996 PST | @ 9556 days 1 hour 32 mins 1 sec ago
+ | epoch | Fri Mar 01 17:32:01 1996 PST | @ 9557 days 1 hour 32 mins 1 sec ago
+ | epoch | Mon Dec 30 17:32:01 1996 PST | @ 9861 days 1 hour 32 mins 1 sec ago
+ | epoch | Tue Dec 31 17:32:01 1996 PST | @ 9862 days 1 hour 32 mins 1 sec ago
+ | epoch | Fri Dec 31 17:32:01 1999 PST | @ 10957 days 1 hour 32 mins 1 sec ago
+ | epoch | Sat Jan 01 17:32:01 2000 PST | @ 10958 days 1 hour 32 mins 1 sec ago
+ | epoch | Sun Dec 31 17:32:01 2000 PST | @ 11323 days 1 hour 32 mins 1 sec ago
+ | epoch | Mon Jan 01 17:32:01 2001 PST | @ 11324 days 1 hour 32 mins 1 sec ago
+ | Wed Feb 28 17:32:01 1996 PST | epoch | @ 9555 days 1 hour 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 | 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
+ | Thu Feb 29 17:32:01 1996 PST | epoch | @ 9556 days 1 hour 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 | 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
+ | Fri Mar 01 17:32:01 1996 PST | epoch | @ 9557 days 1 hour 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 | 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
+ | Mon Dec 30 17:32:01 1996 PST | epoch | @ 9861 days 1 hour 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 | 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
+ | Tue Dec 31 17:32:01 1996 PST | epoch | @ 9862 days 1 hour 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 | 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
+ | Fri Dec 31 17:32:01 1999 PST | epoch | @ 10957 days 1 hour 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 | 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
+ | Sat Jan 01 17:32:01 2000 PST | epoch | @ 10958 days 1 hour 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 | 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
+ | Sun Dec 31 17:32:01 2000 PST | epoch | @ 11323 days 1 hour 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 | 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
+ | Mon Jan 01 17:32:01 2001 PST | epoch | @ 11324 days 1 hour 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 | 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
(100 rows)
-QUERY: SELECT '' as fifty, d1 as datetime,
+SELECT '' as fifty, d1 as datetime,
date_part('year', d1) AS year, date_part('month', d1) AS month,
date_part('day',d1) AS day, date_part('hour', d1) AS hour,
date_part('minute', d1) AS minute, date_part('second', d1) AS second
FROM DATETIME_TBL
WHERE isfinite(d1) and d1 >= '1-jan-1900 GMT'
ORDER BY datetime;
-fifty|datetime |year|month|day|hour|minute| second
------+-------------------------------+----+-----+---+----+------+--------
- |epoch |1969| 12| 31| 16| 0| 0
- |Wed Feb 28 17:32:01 1996 PST |1996| 2| 28| 17| 32| 1
- |Thu Feb 29 17:32:01 1996 PST |1996| 2| 29| 17| 32| 1
- |Fri Mar 01 17:32:01 1996 PST |1996| 3| 1| 17| 32| 1
- |Mon Dec 30 17:32:01 1996 PST |1996| 12| 30| 17| 32| 1
- |Tue Dec 31 17:32:01 1996 PST |1996| 12| 31| 17| 32| 1
- |Wed Jan 01 17:32:01 1997 PST |1997| 1| 1| 17| 32| 1
- |Thu Jan 02 00:00:00 1997 PST |1997| 1| 2| 0| 0| 0
- |Thu Jan 02 03:04:05 1997 PST |1997| 1| 2| 3| 4| 5
- |Mon Feb 10 09:32:01 1997 PST |1997| 2| 10| 9| 32| 1
- |Mon Feb 10 09:32:01 1997 PST |1997| 2| 10| 9| 32| 1
- |Mon Feb 10 09:32:01 1997 PST |1997| 2| 10| 9| 32| 1
- |Mon Feb 10 17:32:00 1997 PST |1997| 2| 10| 17| 32| 0
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01 1997 PST |1997| 2| 10| 17| 32| 1
- |Mon Feb 10 17:32:01.00 1997 PST|1997| 2| 10| 17| 32|1.000001
- |Mon Feb 10 17:32:01.40 1997 PST|1997| 2| 10| 17| 32| 1.4
- |Mon Feb 10 17:32:01.50 1997 PST|1997| 2| 10| 17| 32| 1.5
- |Mon Feb 10 17:32:01.60 1997 PST|1997| 2| 10| 17| 32| 1.6
- |Mon Feb 10 17:32:02.00 1997 PST|1997| 2| 10| 17| 32|1.999999
- |Tue Feb 11 17:32:01 1997 PST |1997| 2| 11| 17| 32| 1
- |Wed Feb 12 17:32:01 1997 PST |1997| 2| 12| 17| 32| 1
- |Thu Feb 13 17:32:01 1997 PST |1997| 2| 13| 17| 32| 1
- |Fri Feb 14 17:32:01 1997 PST |1997| 2| 14| 17| 32| 1
- |Sat Feb 15 17:32:01 1997 PST |1997| 2| 15| 17| 32| 1
- |Sun Feb 16 17:32:01 1997 PST |1997| 2| 16| 17| 32| 1
- |Sun Feb 16 17:32:01 1997 PST |1997| 2| 16| 17| 32| 1
- |Fri Feb 28 17:32:01 1997 PST |1997| 2| 28| 17| 32| 1
- |Sat Mar 01 17:32:01 1997 PST |1997| 3| 1| 17| 32| 1
- |Tue Jun 10 17:32:01 1997 PDT |1997| 6| 10| 17| 32| 1
- |Tue Jun 10 18:32:01 1997 PDT |1997| 6| 10| 18| 32| 1
- |Tue Dec 30 17:32:01 1997 PST |1997| 12| 30| 17| 32| 1
- |Wed Dec 31 17:32:01 1997 PST |1997| 12| 31| 17| 32| 1
- |Fri Dec 31 17:32:01 1999 PST |1999| 12| 31| 17| 32| 1
- |Sat Jan 01 17:32:01 2000 PST |2000| 1| 1| 17| 32| 1
- |Sun Dec 31 17:32:01 2000 PST |2000| 12| 31| 17| 32| 1
- |Mon Jan 01 17:32:01 2001 PST |2001| 1| 1| 17| 32| 1
- |Sat Feb 16 17:32:01 2097 |2097| 2| 16| 17| 32| 1
+ fifty | datetime | year | month | day | hour | minute | second
+-------+---------------------------------+------+-------+-----+------+--------+----------
+ | epoch | 1969 | 12 | 31 | 16 | 0 | 0
+ | Wed Feb 28 17:32:01 1996 PST | 1996 | 2 | 28 | 17 | 32 | 1
+ | Thu Feb 29 17:32:01 1996 PST | 1996 | 2 | 29 | 17 | 32 | 1
+ | Fri Mar 01 17:32:01 1996 PST | 1996 | 3 | 1 | 17 | 32 | 1
+ | Mon Dec 30 17:32:01 1996 PST | 1996 | 12 | 30 | 17 | 32 | 1
+ | Tue Dec 31 17:32:01 1996 PST | 1996 | 12 | 31 | 17 | 32 | 1
+ | Wed Jan 01 17:32:01 1997 PST | 1997 | 1 | 1 | 17 | 32 | 1
+ | Thu Jan 02 00:00:00 1997 PST | 1997 | 1 | 2 | 0 | 0 | 0
+ | Thu Jan 02 03:04:05 1997 PST | 1997 | 1 | 2 | 3 | 4 | 5
+ | Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
+ | Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
+ | Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
+ | Mon Feb 10 17:32:00 1997 PST | 1997 | 2 | 10 | 17 | 32 | 0
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ | Mon Feb 10 17:32:01.00 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.000001
+ | Mon Feb 10 17:32:01.40 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.4
+ | Mon Feb 10 17:32:01.50 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.5
+ | Mon Feb 10 17:32:01.60 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.6
+ | Mon Feb 10 17:32:02.00 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.999999
+ | Tue Feb 11 17:32:01 1997 PST | 1997 | 2 | 11 | 17 | 32 | 1
+ | Wed Feb 12 17:32:01 1997 PST | 1997 | 2 | 12 | 17 | 32 | 1
+ | Thu Feb 13 17:32:01 1997 PST | 1997 | 2 | 13 | 17 | 32 | 1
+ | Fri Feb 14 17:32:01 1997 PST | 1997 | 2 | 14 | 17 | 32 | 1
+ | Sat Feb 15 17:32:01 1997 PST | 1997 | 2 | 15 | 17 | 32 | 1
+ | Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
+ | Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
+ | Fri Feb 28 17:32:01 1997 PST | 1997 | 2 | 28 | 17 | 32 | 1
+ | Sat Mar 01 17:32:01 1997 PST | 1997 | 3 | 1 | 17 | 32 | 1
+ | Tue Jun 10 17:32:01 1997 PDT | 1997 | 6 | 10 | 17 | 32 | 1
+ | Tue Jun 10 18:32:01 1997 PDT | 1997 | 6 | 10 | 18 | 32 | 1
+ | Tue Dec 30 17:32:01 1997 PST | 1997 | 12 | 30 | 17 | 32 | 1
+ | Wed Dec 31 17:32:01 1997 PST | 1997 | 12 | 31 | 17 | 32 | 1
+ | Fri Dec 31 17:32:01 1999 PST | 1999 | 12 | 31 | 17 | 32 | 1
+ | Sat Jan 01 17:32:01 2000 PST | 2000 | 1 | 1 | 17 | 32 | 1
+ | Sun Dec 31 17:32:01 2000 PST | 2000 | 12 | 31 | 17 | 32 | 1
+ | Mon Jan 01 17:32:01 2001 PST | 2001 | 1 | 1 | 17 | 32 | 1
+ | Sat Feb 16 17:32:01 2097 | 2097 | 2 | 16 | 17 | 32 | 1
(49 rows)
-QUERY: SELECT '' AS four, f1 AS abstime,
+--
+-- abstime, reltime arithmetic
+--
+SELECT '' AS four, f1 AS abstime,
date_part('year', f1) AS year, date_part('month', f1) AS month,
date_part('day',f1) AS day, date_part('hour', f1) AS hour,
date_part('minute', f1) AS minute, date_part('second', f1) AS second
FROM ABSTIME_TBL
- WHERE isfinite(f1) and f1 <> 'current'::abstime
+ WHERE isfinite(f1) and f1 <> abstime 'current'
ORDER BY abstime;
-four|abstime |year|month|day|hour|minute|second
-----+----------------------------+----+-----+---+----+------+------
- |Sat May 10 23:59:12 1947 PST|1947| 5| 10| 23| 59| 12
- |epoch |1969| 12| 31| 16| 0| 0
- |Sun Jan 14 03:14:21 1973 PST|1973| 1| 14| 3| 14| 21
- |Mon May 01 00:30:30 1995 PDT|1995| 5| 1| 0| 30| 30
+ four | abstime | year | month | day | hour | minute | second
+------+------------------------------+------+-------+-----+------+--------+--------
+ | Sat May 10 23:59:12 1947 PST | 1947 | 5 | 10 | 23 | 59 | 12
+ | epoch | 1969 | 12 | 31 | 16 | 0 | 0
+ | Sun Jan 14 03:14:21 1973 PST | 1973 | 1 | 14 | 3 | 14 | 21
+ | Mon May 01 00:30:30 1995 PDT | 1995 | 5 | 1 | 0 | 30 | 30
(4 rows)
-QUERY: SELECT '' AS ten, f1 AS datetime, date( f1) AS date
+--
+-- conversions
+--
+SELECT '' AS ten, f1 AS datetime, date( f1) AS date
FROM TEMP_DATETIME
- WHERE f1 <> 'current'::datetime
+ WHERE f1 <> datetime 'current'
ORDER BY date;
-ten|datetime | date
----+----------------------------+----------
- |epoch |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
- |Sun Dec 31 17:32:01 2000 PST|12-31-2000
- |Mon Jan 01 17:32:01 2001 PST|01-01-2001
+ ten | datetime | date
+-----+------------------------------+------------
+ | epoch | 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
+ | Sun Dec 31 17:32:01 2000 PST | 12-31-2000
+ | Mon Jan 01 17:32:01 2001 PST | 01-01-2001
(10 rows)
-QUERY: SELECT '' AS ten, f1 AS datetime, abstime( f1) AS abstime
+SELECT '' AS ten, f1 AS datetime, abstime( f1) AS abstime
FROM TEMP_DATETIME
ORDER BY abstime;
-ten|datetime |abstime
----+----------------------------+----------------------------
- |epoch |epoch
- |Wed Feb 28 17:32:01 1996 PST|Wed Feb 28 17:32:01 1996 PST
- |Thu Feb 29 17:32:01 1996 PST|Thu Feb 29 17:32:01 1996 PST
- |Fri Mar 01 17:32:01 1996 PST|Fri Mar 01 17:32:01 1996 PST
- |Mon Dec 30 17:32:01 1996 PST|Mon Dec 30 17:32:01 1996 PST
- |Tue Dec 31 17:32:01 1996 PST|Tue Dec 31 17:32:01 1996 PST
- |Fri Dec 31 17:32:01 1999 PST|Fri Dec 31 17:32:01 1999 PST
- |Sat Jan 01 17:32:01 2000 PST|Sat Jan 01 17:32:01 2000 PST
- |Sun Dec 31 17:32:01 2000 PST|Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST|Mon Jan 01 17:32:01 2001 PST
+ ten | datetime | abstime
+-----+------------------------------+------------------------------
+ | epoch | epoch
+ | Wed Feb 28 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST
+ | Thu Feb 29 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST
+ | Fri Mar 01 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST
+ | Mon Dec 30 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST
+ | Tue Dec 31 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST
+ | Fri Dec 31 17:32:01 1999 PST | Fri Dec 31 17:32:01 1999 PST
+ | Sat Jan 01 17:32:01 2000 PST | Sat Jan 01 17:32:01 2000 PST
+ | Sun Dec 31 17:32:01 2000 PST | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST | Mon Jan 01 17:32:01 2001 PST
(10 rows)
-QUERY: SELECT '' AS five, f1 AS abstime, date( f1) AS date
+SELECT '' AS five, f1 AS abstime, date( f1) AS date
FROM ABSTIME_TBL
- WHERE isfinite(f1) AND f1 <> 'current'::abstime
+ WHERE isfinite(f1) AND f1 <> abstime 'current'
ORDER BY date;
-five|abstime | date
-----+----------------------------+----------
- |Sat May 10 23:59:12 1947 PST|05-10-1947
- |epoch |01-01-1970
- |Sun Jan 14 03:14:21 1973 PST|01-14-1973
- |Mon May 01 00:30:30 1995 PDT|05-01-1995
+ five | abstime | date
+------+------------------------------+------------
+ | Sat May 10 23:59:12 1947 PST | 05-10-1947
+ | epoch | 01-01-1970
+ | Sun Jan 14 03:14:21 1973 PST | 01-14-1973
+ | Mon May 01 00:30:30 1995 PDT | 05-01-1995
(4 rows)
-QUERY: SELECT '' AS five, d1 AS datetime, abstime(d1) AS abstime
+SELECT '' AS five, d1 AS datetime, abstime(d1) AS abstime
FROM DATETIME_TBL WHERE NOT isfinite(d1);
-five|datetime |abstime
-----+---------+---------
- |invalid |invalid
- |-infinity|-infinity
- |infinity |infinity
- |invalid |invalid
- |invalid |invalid
+ five | datetime | abstime
+------+-----------+-----------
+ | invalid | invalid
+ | -infinity | -infinity
+ | infinity | infinity
+ | invalid | invalid
+ | invalid | invalid
(5 rows)
-QUERY: SELECT '' AS three, f1 as abstime, datetime(f1) AS datetime
+SELECT '' AS three, f1 as abstime, datetime(f1) AS datetime
FROM ABSTIME_TBL WHERE NOT isfinite(f1);
-three|abstime |datetime
------+---------+---------
- |infinity |infinity
- |-infinity|-infinity
- |invalid |invalid
+ three | abstime | datetime
+-------+-----------+-----------
+ | infinity | infinity
+ | -infinity | -infinity
+ | invalid | invalid
(3 rows)
-QUERY: SELECT '' AS ten, f1 AS timespan, reltime( f1) AS reltime
+SELECT '' AS ten, f1 AS timespan, reltime( f1) AS reltime
FROM TIMESPAN_TBL;
-ten|timespan |reltime
----+-----------------------------+-----------------------------
- |@ 1 min |@ 1 min
- |@ 5 hours |@ 5 hours
- |@ 10 days |@ 10 days
- |@ 34 years |@ 34 years
- |@ 3 mons |@ 3 mons
- |@ 14 secs ago |@ 14 secs ago
- |@ 1 day 2 hours 3 mins 4 secs|@ 1 day 2 hours 3 mins 4 secs
- |@ 6 years |@ 6 years
- |@ 5 mons |@ 5 mons
- |@ 5 mons 12 hours |@ 5 mons 12 hours
+ ten | timespan | reltime
+-----+-------------------------------+-------------------------------
+ | @ 1 min | @ 1 min
+ | @ 5 hours | @ 5 hours
+ | @ 10 days | @ 10 days
+ | @ 34 years | @ 34 years
+ | @ 3 mons | @ 3 mons
+ | @ 14 secs ago | @ 14 secs ago
+ | @ 1 day 2 hours 3 mins 4 secs | @ 1 day 2 hours 3 mins 4 secs
+ | @ 6 years | @ 6 years
+ | @ 5 mons | @ 5 mons
+ | @ 5 mons 12 hours | @ 5 mons 12 hours
(10 rows)
-QUERY: SELECT '' AS six, f1 as reltime, timespan( f1) AS timespan
+SELECT '' AS six, f1 as reltime, timespan( f1) AS timespan
FROM RELTIME_TBL;
-six|reltime |timespan
----+-------------+-------------
- |@ 1 min |@ 1 min
- |@ 5 hours |@ 5 hours
- |@ 10 days |@ 10 days
- |@ 34 years |@ 34 years
- |@ 3 mons |@ 3 mons
- |@ 14 secs ago|@ 14 secs ago
+ six | reltime | timespan
+-----+---------------+---------------
+ | @ 1 min | @ 1 min
+ | @ 5 hours | @ 5 hours
+ | @ 10 days | @ 10 days
+ | @ 34 years | @ 34 years
+ | @ 3 mons | @ 3 mons
+ | @ 14 secs ago | @ 14 secs ago
(6 rows)
-QUERY: DROP TABLE TEMP_DATETIME;
-QUERY: SET DateStyle TO 'US,Postgres';
-QUERY: SHOW DateStyle;
+DROP TABLE TEMP_DATETIME;
+--
+-- formats
+--
+SET DateStyle TO 'US,Postgres';
NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
-QUERY: SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
-sixty_two|us_postgres
----------+-------------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |Mon Feb 10 17:32:01 1997 PST
- |invalid
- |invalid
- |Mon Feb 10 17:32:01.00 1997 PST
- |Mon Feb 10 17:32:02.00 1997 PST
- |Mon Feb 10 17:32:01.40 1997 PST
- |Mon Feb 10 17:32:01.50 1997 PST
- |Mon Feb 10 17:32:01.60 1997 PST
- |Thu Jan 02 00:00:00 1997 PST
- |Thu Jan 02 03:04:05 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Jun 10 17:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:00 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Tue Jun 10 18:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Feb 11 17:32:01 1997 PST
- |Wed Feb 12 17:32:01 1997 PST
- |Thu Feb 13 17:32:01 1997 PST
- |Fri Feb 14 17:32:01 1997 PST
- |Sat Feb 15 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Tue Feb 16 17:32 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 PST
- |Sat Feb 16 17:32:01 2097
- |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
- |Wed Jan 01 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
- |Fri Dec 31 17:32:01 1999 PST
- |Sat Jan 01 17:32:01 2000 PST
- |Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST
+SHOW DateStyle;
+SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
+ sixty_two | us_postgres
+-----------+---------------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | Mon Feb 10 17:32:01 1997 PST
+ | invalid
+ | invalid
+ | Mon Feb 10 17:32:01.00 1997 PST
+ | Mon Feb 10 17:32:02.00 1997 PST
+ | Mon Feb 10 17:32:01.40 1997 PST
+ | Mon Feb 10 17:32:01.50 1997 PST
+ | Mon Feb 10 17:32:01.60 1997 PST
+ | Thu Jan 02 00:00:00 1997 PST
+ | Thu Jan 02 03:04:05 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Jun 10 17:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:00 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Tue Jun 10 18:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Feb 11 17:32:01 1997 PST
+ | Wed Feb 12 17:32:01 1997 PST
+ | Thu Feb 13 17:32:01 1997 PST
+ | Fri Feb 14 17:32:01 1997 PST
+ | Sat Feb 15 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Tue Feb 16 17:32 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 PST
+ | Sat Feb 16 17:32:01 2097
+ | 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
+ | Wed Jan 01 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
+ | Fri Dec 31 17:32:01 1999 PST
+ | Sat Jan 01 17:32:01 2000 PST
+ | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST
(61 rows)
-QUERY: SELECT '' AS eight, f1 AS us_postgres FROM ABSTIME_TBL;
-eight|us_postgres
------+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |Mon May 01 00:30:30 1995 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |Sat May 10 23:59:12 1947 PST
- |invalid
+SELECT '' AS eight, f1 AS us_postgres FROM ABSTIME_TBL;
+ eight | us_postgres
+-------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | Mon May 01 00:30:30 1995 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | Sat May 10 23:59:12 1947 PST
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'US,ISO';
-QUERY: SELECT '' AS sixty_two, d1 AS us_iso FROM DATETIME_TBL;
-sixty_two|us_iso
----------+-------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |1997-02-10 17:32:01-08
- |invalid
- |invalid
- |1997-02-10 17:32:01.00-08
- |1997-02-10 17:32:02.00-08
- |1997-02-10 17:32:01.40-08
- |1997-02-10 17:32:01.50-08
- |1997-02-10 17:32:01.60-08
- |1997-01-02 00:00:00-08
- |1997-01-02 03:04:05-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-06-10 17:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:00-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-06-10 18:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-11 17:32:01-08
- |1997-02-12 17:32:01-08
- |1997-02-13 17:32:01-08
- |1997-02-14 17:32:01-08
- |1997-02-15 17:32:01-08
- |1997-02-16 17:32:01-08
- |0097-02-16 17:32 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-08
- |2097-02-16 17:32:01
- |1996-02-28 17:32:01-08
- |1996-02-29 17:32:01-08
- |1996-03-01 17:32:01-08
- |1996-12-30 17:32:01-08
- |1996-12-31 17:32:01-08
- |1997-01-01 17:32:01-08
- |1997-02-28 17:32:01-08
- |1997-03-01 17:32:01-08
- |1997-12-30 17:32:01-08
- |1997-12-31 17:32:01-08
- |1999-12-31 17:32:01-08
- |2000-01-01 17:32:01-08
- |2000-12-31 17:32:01-08
- |2001-01-01 17:32:01-08
+SET DateStyle TO 'US,ISO';
+SELECT '' AS sixty_two, d1 AS us_iso FROM DATETIME_TBL;
+ sixty_two | us_iso
+-----------+---------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 1997-02-10 17:32:01-08
+ | invalid
+ | invalid
+ | 1997-02-10 17:32:01.00-08
+ | 1997-02-10 17:32:02.00-08
+ | 1997-02-10 17:32:01.40-08
+ | 1997-02-10 17:32:01.50-08
+ | 1997-02-10 17:32:01.60-08
+ | 1997-01-02 00:00:00-08
+ | 1997-01-02 03:04:05-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-06-10 17:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:00-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-06-10 18:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-11 17:32:01-08
+ | 1997-02-12 17:32:01-08
+ | 1997-02-13 17:32:01-08
+ | 1997-02-14 17:32:01-08
+ | 1997-02-15 17:32:01-08
+ | 1997-02-16 17:32:01-08
+ | 0097-02-16 17:32 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-08
+ | 2097-02-16 17:32:01
+ | 1996-02-28 17:32:01-08
+ | 1996-02-29 17:32:01-08
+ | 1996-03-01 17:32:01-08
+ | 1996-12-30 17:32:01-08
+ | 1996-12-31 17:32:01-08
+ | 1997-01-01 17:32:01-08
+ | 1997-02-28 17:32:01-08
+ | 1997-03-01 17:32:01-08
+ | 1997-12-30 17:32:01-08
+ | 1997-12-31 17:32:01-08
+ | 1999-12-31 17:32:01-08
+ | 2000-01-01 17:32:01-08
+ | 2000-12-31 17:32:01-08
+ | 2001-01-01 17:32:01-08
(61 rows)
-QUERY: SELECT '' AS eight, f1 AS us_iso FROM ABSTIME_TBL;
-eight|us_iso
------+----------------------
- |1973-01-14 03:14:21-08
- |1995-05-01 00:30:30-07
- |epoch
- |current
- |infinity
- |-infinity
- |1947-05-10 23:59:12-08
- |invalid
+SELECT '' AS eight, f1 AS us_iso FROM ABSTIME_TBL;
+ eight | us_iso
+-------+------------------------
+ | 1973-01-14 03:14:21-08
+ | 1995-05-01 00:30:30-07
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 1947-05-10 23:59:12-08
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'US,SQL';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'US,SQL';
NOTICE: DateStyle is SQL with US (NonEuropean) conventions
-QUERY: SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
-sixty_two|us_sql
----------+--------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |02/10/1997 17:32:01.00 PST
- |invalid
- |invalid
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:02.00 PST
- |02/10/1997 17:32:01.40 PST
- |02/10/1997 17:32:01.50 PST
- |02/10/1997 17:32:01.60 PST
- |01/02/1997 00:00:00.00 PST
- |01/02/1997 03:04:05.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |06/10/1997 17:32:01.00 PDT
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:00.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 09:32:01.00 PST
- |02/10/1997 09:32:01.00 PST
- |02/10/1997 09:32:01.00 PST
- |06/10/1997 18:32:01.00 PDT
- |02/10/1997 17:32:01.00 PST
- |02/11/1997 17:32:01.00 PST
- |02/12/1997 17:32:01.00 PST
- |02/13/1997 17:32:01.00 PST
- |02/14/1997 17:32:01.00 PST
- |02/15/1997 17:32:01.00 PST
- |02/16/1997 17:32:01.00 PST
- |02/16/0097 17:32 BC
- |02/16/0097 17:32:01.00
- |02/16/0597 17:32:01.00
- |02/16/1097 17:32:01.00
- |02/16/1697 17:32:01.00
- |02/16/1797 17:32:01.00
- |02/16/1897 17:32:01.00
- |02/16/1997 17:32:01.00 PST
- |02/16/2097 17:32:01.00
- |02/28/1996 17:32:01.00 PST
- |02/29/1996 17:32:01.00 PST
- |03/01/1996 17:32:01.00 PST
- |12/30/1996 17:32:01.00 PST
- |12/31/1996 17:32:01.00 PST
- |01/01/1997 17:32:01.00 PST
- |02/28/1997 17:32:01.00 PST
- |03/01/1997 17:32:01.00 PST
- |12/30/1997 17:32:01.00 PST
- |12/31/1997 17:32:01.00 PST
- |12/31/1999 17:32:01.00 PST
- |01/01/2000 17:32:01.00 PST
- |12/31/2000 17:32:01.00 PST
- |01/01/2001 17:32:01.00 PST
+SHOW DateStyle;
+SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
+ sixty_two | us_sql
+-----------+----------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 02/10/1997 17:32:01.00 PST
+ | invalid
+ | invalid
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:02.00 PST
+ | 02/10/1997 17:32:01.40 PST
+ | 02/10/1997 17:32:01.50 PST
+ | 02/10/1997 17:32:01.60 PST
+ | 01/02/1997 00:00:00.00 PST
+ | 01/02/1997 03:04:05.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 06/10/1997 17:32:01.00 PDT
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:00.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 09:32:01.00 PST
+ | 02/10/1997 09:32:01.00 PST
+ | 02/10/1997 09:32:01.00 PST
+ | 06/10/1997 18:32:01.00 PDT
+ | 02/10/1997 17:32:01.00 PST
+ | 02/11/1997 17:32:01.00 PST
+ | 02/12/1997 17:32:01.00 PST
+ | 02/13/1997 17:32:01.00 PST
+ | 02/14/1997 17:32:01.00 PST
+ | 02/15/1997 17:32:01.00 PST
+ | 02/16/1997 17:32:01.00 PST
+ | 02/16/0097 17:32 BC
+ | 02/16/0097 17:32:01.00
+ | 02/16/0597 17:32:01.00
+ | 02/16/1097 17:32:01.00
+ | 02/16/1697 17:32:01.00
+ | 02/16/1797 17:32:01.00
+ | 02/16/1897 17:32:01.00
+ | 02/16/1997 17:32:01.00 PST
+ | 02/16/2097 17:32:01.00
+ | 02/28/1996 17:32:01.00 PST
+ | 02/29/1996 17:32:01.00 PST
+ | 03/01/1996 17:32:01.00 PST
+ | 12/30/1996 17:32:01.00 PST
+ | 12/31/1996 17:32:01.00 PST
+ | 01/01/1997 17:32:01.00 PST
+ | 02/28/1997 17:32:01.00 PST
+ | 03/01/1997 17:32:01.00 PST
+ | 12/30/1997 17:32:01.00 PST
+ | 12/31/1997 17:32:01.00 PST
+ | 12/31/1999 17:32:01.00 PST
+ | 01/01/2000 17:32:01.00 PST
+ | 12/31/2000 17:32:01.00 PST
+ | 01/01/2001 17:32:01.00 PST
(61 rows)
-QUERY: SELECT '' AS eight, f1 AS us_sql FROM ABSTIME_TBL;
-eight|us_sql
------+--------------------------
- |01/14/1973 03:14:21.00 PST
- |05/01/1995 00:30:30.00 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |05/10/1947 23:59:12.00 PST
- |invalid
+SELECT '' AS eight, f1 AS us_sql FROM ABSTIME_TBL;
+ eight | us_sql
+-------+----------------------------
+ | 01/14/1973 03:14:21.00 PST
+ | 05/01/1995 00:30:30.00 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 05/10/1947 23:59:12.00 PST
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'European,Postgres';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'European,Postgres';
NOTICE: DateStyle is Postgres with European conventions
-QUERY: INSERT INTO DATETIME_TBL VALUES('13/06/1957');
-QUERY: SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
-one
----
- 1
+SHOW DateStyle;
+INSERT INTO DATETIME_TBL VALUES('13/06/1957');
+SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
+ one
+-----
+ 1
(1 row)
-QUERY: SELECT '' AS sixty_three, d1 AS european_postgres FROM DATETIME_TBL;
-sixty_three|european_postgres
------------+-------------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |Mon 10 Feb 17:32:01 1997 PST
- |invalid
- |invalid
- |Mon 10 Feb 17:32:01.00 1997 PST
- |Mon 10 Feb 17:32:02.00 1997 PST
- |Mon 10 Feb 17:32:01.40 1997 PST
- |Mon 10 Feb 17:32:01.50 1997 PST
- |Mon 10 Feb 17:32:01.60 1997 PST
- |Thu 02 Jan 00:00:00 1997 PST
- |Thu 02 Jan 03:04:05 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Tue 10 Jun 17:32:01 1997 PDT
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:00 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 09:32:01 1997 PST
- |Mon 10 Feb 09:32:01 1997 PST
- |Mon 10 Feb 09:32:01 1997 PST
- |Tue 10 Jun 18:32:01 1997 PDT
- |Mon 10 Feb 17:32:01 1997 PST
- |Tue 11 Feb 17:32:01 1997 PST
- |Wed 12 Feb 17:32:01 1997 PST
- |Thu 13 Feb 17:32:01 1997 PST
- |Fri 14 Feb 17:32:01 1997 PST
- |Sat 15 Feb 17:32:01 1997 PST
- |Sun 16 Feb 17:32:01 1997 PST
- |Tue 16 Feb 17:32 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 PST
- |Sat 16 Feb 17:32:01 2097
- |Wed 28 Feb 17:32:01 1996 PST
- |Thu 29 Feb 17:32:01 1996 PST
- |Fri 01 Mar 17:32:01 1996 PST
- |Mon 30 Dec 17:32:01 1996 PST
- |Tue 31 Dec 17:32:01 1996 PST
- |Wed 01 Jan 17:32:01 1997 PST
- |Fri 28 Feb 17:32:01 1997 PST
- |Sat 01 Mar 17:32:01 1997 PST
- |Tue 30 Dec 17:32:01 1997 PST
- |Wed 31 Dec 17:32:01 1997 PST
- |Fri 31 Dec 17:32:01 1999 PST
- |Sat 01 Jan 17:32:01 2000 PST
- |Sun 31 Dec 17:32:01 2000 PST
- |Mon 01 Jan 17:32:01 2001 PST
- |Thu 13 Jun 00:00:00 1957 PDT
+SELECT '' AS sixty_three, d1 AS european_postgres FROM DATETIME_TBL;
+ sixty_three | european_postgres
+-------------+---------------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | Mon 10 Feb 17:32:01 1997 PST
+ | invalid
+ | invalid
+ | Mon 10 Feb 17:32:01.00 1997 PST
+ | Mon 10 Feb 17:32:02.00 1997 PST
+ | Mon 10 Feb 17:32:01.40 1997 PST
+ | Mon 10 Feb 17:32:01.50 1997 PST
+ | Mon 10 Feb 17:32:01.60 1997 PST
+ | Thu 02 Jan 00:00:00 1997 PST
+ | Thu 02 Jan 03:04:05 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Tue 10 Jun 17:32:01 1997 PDT
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:00 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 09:32:01 1997 PST
+ | Mon 10 Feb 09:32:01 1997 PST
+ | Mon 10 Feb 09:32:01 1997 PST
+ | Tue 10 Jun 18:32:01 1997 PDT
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Tue 11 Feb 17:32:01 1997 PST
+ | Wed 12 Feb 17:32:01 1997 PST
+ | Thu 13 Feb 17:32:01 1997 PST
+ | Fri 14 Feb 17:32:01 1997 PST
+ | Sat 15 Feb 17:32:01 1997 PST
+ | Sun 16 Feb 17:32:01 1997 PST
+ | Tue 16 Feb 17:32 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 PST
+ | Sat 16 Feb 17:32:01 2097
+ | Wed 28 Feb 17:32:01 1996 PST
+ | Thu 29 Feb 17:32:01 1996 PST
+ | Fri 01 Mar 17:32:01 1996 PST
+ | Mon 30 Dec 17:32:01 1996 PST
+ | Tue 31 Dec 17:32:01 1996 PST
+ | Wed 01 Jan 17:32:01 1997 PST
+ | Fri 28 Feb 17:32:01 1997 PST
+ | Sat 01 Mar 17:32:01 1997 PST
+ | Tue 30 Dec 17:32:01 1997 PST
+ | Wed 31 Dec 17:32:01 1997 PST
+ | Fri 31 Dec 17:32:01 1999 PST
+ | Sat 01 Jan 17:32:01 2000 PST
+ | Sun 31 Dec 17:32:01 2000 PST
+ | Mon 01 Jan 17:32:01 2001 PST
+ | Thu 13 Jun 00:00:00 1957 PDT
(62 rows)
-QUERY: SELECT '' AS eight, f1 AS european_postgres FROM ABSTIME_TBL;
-eight|european_postgres
------+----------------------------
- |Sun 14 Jan 03:14:21 1973 PST
- |Mon 01 May 00:30:30 1995 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |Sat 10 May 23:59:12 1947 PST
- |invalid
+SELECT '' AS eight, f1 AS european_postgres FROM ABSTIME_TBL;
+ eight | european_postgres
+-------+------------------------------
+ | Sun 14 Jan 03:14:21 1973 PST
+ | Mon 01 May 00:30:30 1995 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | Sat 10 May 23:59:12 1947 PST
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'European,ISO';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'European,ISO';
NOTICE: DateStyle is ISO with European conventions
-QUERY: SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
-sixty_three|european_iso
------------+-------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |1997-02-10 17:32:01-08
- |invalid
- |invalid
- |1997-02-10 17:32:01.00-08
- |1997-02-10 17:32:02.00-08
- |1997-02-10 17:32:01.40-08
- |1997-02-10 17:32:01.50-08
- |1997-02-10 17:32:01.60-08
- |1997-01-02 00:00:00-08
- |1997-01-02 03:04:05-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-06-10 17:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:00-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-06-10 18:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-11 17:32:01-08
- |1997-02-12 17:32:01-08
- |1997-02-13 17:32:01-08
- |1997-02-14 17:32:01-08
- |1997-02-15 17:32:01-08
- |1997-02-16 17:32:01-08
- |0097-02-16 17:32 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-08
- |2097-02-16 17:32:01
- |1996-02-28 17:32:01-08
- |1996-02-29 17:32:01-08
- |1996-03-01 17:32:01-08
- |1996-12-30 17:32:01-08
- |1996-12-31 17:32:01-08
- |1997-01-01 17:32:01-08
- |1997-02-28 17:32:01-08
- |1997-03-01 17:32:01-08
- |1997-12-30 17:32:01-08
- |1997-12-31 17:32:01-08
- |1999-12-31 17:32:01-08
- |2000-01-01 17:32:01-08
- |2000-12-31 17:32:01-08
- |2001-01-01 17:32:01-08
- |1957-06-13 00:00:00-07
+SHOW DateStyle;
+SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
+ sixty_three | european_iso
+-------------+---------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 1997-02-10 17:32:01-08
+ | invalid
+ | invalid
+ | 1997-02-10 17:32:01.00-08
+ | 1997-02-10 17:32:02.00-08
+ | 1997-02-10 17:32:01.40-08
+ | 1997-02-10 17:32:01.50-08
+ | 1997-02-10 17:32:01.60-08
+ | 1997-01-02 00:00:00-08
+ | 1997-01-02 03:04:05-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-06-10 17:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:00-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-06-10 18:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-11 17:32:01-08
+ | 1997-02-12 17:32:01-08
+ | 1997-02-13 17:32:01-08
+ | 1997-02-14 17:32:01-08
+ | 1997-02-15 17:32:01-08
+ | 1997-02-16 17:32:01-08
+ | 0097-02-16 17:32 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-08
+ | 2097-02-16 17:32:01
+ | 1996-02-28 17:32:01-08
+ | 1996-02-29 17:32:01-08
+ | 1996-03-01 17:32:01-08
+ | 1996-12-30 17:32:01-08
+ | 1996-12-31 17:32:01-08
+ | 1997-01-01 17:32:01-08
+ | 1997-02-28 17:32:01-08
+ | 1997-03-01 17:32:01-08
+ | 1997-12-30 17:32:01-08
+ | 1997-12-31 17:32:01-08
+ | 1999-12-31 17:32:01-08
+ | 2000-01-01 17:32:01-08
+ | 2000-12-31 17:32:01-08
+ | 2001-01-01 17:32:01-08
+ | 1957-06-13 00:00:00-07
(62 rows)
-QUERY: SELECT '' AS eight, f1 AS european_iso FROM ABSTIME_TBL;
-eight|european_iso
------+----------------------
- |1973-01-14 03:14:21-08
- |1995-05-01 00:30:30-07
- |epoch
- |current
- |infinity
- |-infinity
- |1947-05-10 23:59:12-08
- |invalid
+SELECT '' AS eight, f1 AS european_iso FROM ABSTIME_TBL;
+ eight | european_iso
+-------+------------------------
+ | 1973-01-14 03:14:21-08
+ | 1995-05-01 00:30:30-07
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 1947-05-10 23:59:12-08
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'European,SQL';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'European,SQL';
NOTICE: DateStyle is SQL with European conventions
-QUERY: SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
-sixty_three|european_sql
------------+--------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |10/02/1997 17:32:01.00 PST
- |invalid
- |invalid
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:02.00 PST
- |10/02/1997 17:32:01.40 PST
- |10/02/1997 17:32:01.50 PST
- |10/02/1997 17:32:01.60 PST
- |02/01/1997 00:00:00.00 PST
- |02/01/1997 03:04:05.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/06/1997 17:32:01.00 PDT
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:00.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 09:32:01.00 PST
- |10/02/1997 09:32:01.00 PST
- |10/02/1997 09:32:01.00 PST
- |10/06/1997 18:32:01.00 PDT
- |10/02/1997 17:32:01.00 PST
- |11/02/1997 17:32:01.00 PST
- |12/02/1997 17:32:01.00 PST
- |13/02/1997 17:32:01.00 PST
- |14/02/1997 17:32:01.00 PST
- |15/02/1997 17:32:01.00 PST
- |16/02/1997 17:32:01.00 PST
- |16/02/0097 17:32 BC
- |16/02/0097 17:32:01.00
- |16/02/0597 17:32:01.00
- |16/02/1097 17:32:01.00
- |16/02/1697 17:32:01.00
- |16/02/1797 17:32:01.00
- |16/02/1897 17:32:01.00
- |16/02/1997 17:32:01.00 PST
- |16/02/2097 17:32:01.00
- |28/02/1996 17:32:01.00 PST
- |29/02/1996 17:32:01.00 PST
- |01/03/1996 17:32:01.00 PST
- |30/12/1996 17:32:01.00 PST
- |31/12/1996 17:32:01.00 PST
- |01/01/1997 17:32:01.00 PST
- |28/02/1997 17:32:01.00 PST
- |01/03/1997 17:32:01.00 PST
- |30/12/1997 17:32:01.00 PST
- |31/12/1997 17:32:01.00 PST
- |31/12/1999 17:32:01.00 PST
- |01/01/2000 17:32:01.00 PST
- |31/12/2000 17:32:01.00 PST
- |01/01/2001 17:32:01.00 PST
- |13/06/1957 00:00:00.00 PDT
+SHOW DateStyle;
+SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
+ sixty_three | european_sql
+-------------+----------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 10/02/1997 17:32:01.00 PST
+ | invalid
+ | invalid
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:02.00 PST
+ | 10/02/1997 17:32:01.40 PST
+ | 10/02/1997 17:32:01.50 PST
+ | 10/02/1997 17:32:01.60 PST
+ | 02/01/1997 00:00:00.00 PST
+ | 02/01/1997 03:04:05.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/06/1997 17:32:01.00 PDT
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:00.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 09:32:01.00 PST
+ | 10/02/1997 09:32:01.00 PST
+ | 10/02/1997 09:32:01.00 PST
+ | 10/06/1997 18:32:01.00 PDT
+ | 10/02/1997 17:32:01.00 PST
+ | 11/02/1997 17:32:01.00 PST
+ | 12/02/1997 17:32:01.00 PST
+ | 13/02/1997 17:32:01.00 PST
+ | 14/02/1997 17:32:01.00 PST
+ | 15/02/1997 17:32:01.00 PST
+ | 16/02/1997 17:32:01.00 PST
+ | 16/02/0097 17:32 BC
+ | 16/02/0097 17:32:01.00
+ | 16/02/0597 17:32:01.00
+ | 16/02/1097 17:32:01.00
+ | 16/02/1697 17:32:01.00
+ | 16/02/1797 17:32:01.00
+ | 16/02/1897 17:32:01.00
+ | 16/02/1997 17:32:01.00 PST
+ | 16/02/2097 17:32:01.00
+ | 28/02/1996 17:32:01.00 PST
+ | 29/02/1996 17:32:01.00 PST
+ | 01/03/1996 17:32:01.00 PST
+ | 30/12/1996 17:32:01.00 PST
+ | 31/12/1996 17:32:01.00 PST
+ | 01/01/1997 17:32:01.00 PST
+ | 28/02/1997 17:32:01.00 PST
+ | 01/03/1997 17:32:01.00 PST
+ | 30/12/1997 17:32:01.00 PST
+ | 31/12/1997 17:32:01.00 PST
+ | 31/12/1999 17:32:01.00 PST
+ | 01/01/2000 17:32:01.00 PST
+ | 31/12/2000 17:32:01.00 PST
+ | 01/01/2001 17:32:01.00 PST
+ | 13/06/1957 00:00:00.00 PDT
(62 rows)
-QUERY: SELECT '' AS eight, f1 AS european_sql FROM ABSTIME_TBL;
-eight|european_sql
------+--------------------------
- |14/01/1973 03:14:21.00 PST
- |01/05/1995 00:30:30.00 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |10/05/1947 23:59:12.00 PST
- |invalid
+SELECT '' AS eight, f1 AS european_sql FROM ABSTIME_TBL;
+ eight | european_sql
+-------+----------------------------
+ | 14/01/1973 03:14:21.00 PST
+ | 01/05/1995 00:30:30.00 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 10/05/1947 23:59:12.00 PST
+ | invalid
(8 rows)
-QUERY: RESET DateStyle;
-QUERY: SHOW DateStyle;
+RESET DateStyle;
NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
-QUERY: SET DateStyle TO 'US,Postgres';
-QUERY: SHOW DateStyle;
+SHOW DateStyle;
+--
+-- formats
+--
+SET DateStyle TO 'US,Postgres';
NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
-QUERY: SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
-sixty_two|us_postgres
----------+-------------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |Mon Feb 10 17:32:01 1997 PST
- |invalid
- |invalid
- |Mon Feb 10 17:32:01.00 1997 PST
- |Mon Feb 10 17:32:02.00 1997 PST
- |Mon Feb 10 17:32:01.40 1997 PST
- |Mon Feb 10 17:32:01.50 1997 PST
- |Mon Feb 10 17:32:01.60 1997 PST
- |Thu Jan 02 00:00:00 1997 PST
- |Thu Jan 02 03:04:05 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Jun 10 17:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:00 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 17:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Mon Feb 10 09:32:01 1997 PST
- |Tue Jun 10 18:32:01 1997 PDT
- |Mon Feb 10 17:32:01 1997 PST
- |Tue Feb 11 17:32:01 1997 PST
- |Wed Feb 12 17:32:01 1997 PST
- |Thu Feb 13 17:32:01 1997 PST
- |Fri Feb 14 17:32:01 1997 PST
- |Sat Feb 15 17:32:01 1997 PST
- |Sun Feb 16 17:32:01 1997 PST
- |Tue Feb 16 17:32 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 PST
- |Sat Feb 16 17:32:01 2097
- |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
- |Wed Jan 01 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
- |Fri Dec 31 17:32:01 1999 PST
- |Sat Jan 01 17:32:01 2000 PST
- |Sun Dec 31 17:32:01 2000 PST
- |Mon Jan 01 17:32:01 2001 PST
- |Thu Jun 13 00:00:00 1957 PDT
+SHOW DateStyle;
+SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
+ sixty_two | us_postgres
+-----------+---------------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | Mon Feb 10 17:32:01 1997 PST
+ | invalid
+ | invalid
+ | Mon Feb 10 17:32:01.00 1997 PST
+ | Mon Feb 10 17:32:02.00 1997 PST
+ | Mon Feb 10 17:32:01.40 1997 PST
+ | Mon Feb 10 17:32:01.50 1997 PST
+ | Mon Feb 10 17:32:01.60 1997 PST
+ | Thu Jan 02 00:00:00 1997 PST
+ | Thu Jan 02 03:04:05 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Jun 10 17:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:00 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 17:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Mon Feb 10 09:32:01 1997 PST
+ | Tue Jun 10 18:32:01 1997 PDT
+ | Mon Feb 10 17:32:01 1997 PST
+ | Tue Feb 11 17:32:01 1997 PST
+ | Wed Feb 12 17:32:01 1997 PST
+ | Thu Feb 13 17:32:01 1997 PST
+ | Fri Feb 14 17:32:01 1997 PST
+ | Sat Feb 15 17:32:01 1997 PST
+ | Sun Feb 16 17:32:01 1997 PST
+ | Tue Feb 16 17:32 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 PST
+ | Sat Feb 16 17:32:01 2097
+ | 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
+ | Wed Jan 01 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
+ | Fri Dec 31 17:32:01 1999 PST
+ | Sat Jan 01 17:32:01 2000 PST
+ | Sun Dec 31 17:32:01 2000 PST
+ | Mon Jan 01 17:32:01 2001 PST
+ | Thu Jun 13 00:00:00 1957 PDT
(62 rows)
-QUERY: SELECT '' AS eight, f1 AS us_postgres FROM ABSTIME_TBL;
-eight|us_postgres
------+----------------------------
- |Sun Jan 14 03:14:21 1973 PST
- |Mon May 01 00:30:30 1995 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |Sat May 10 23:59:12 1947 PST
- |invalid
+SELECT '' AS eight, f1 AS us_postgres FROM ABSTIME_TBL;
+ eight | us_postgres
+-------+------------------------------
+ | Sun Jan 14 03:14:21 1973 PST
+ | Mon May 01 00:30:30 1995 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | Sat May 10 23:59:12 1947 PST
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'US,ISO';
-QUERY: SELECT '' AS sixty_two, d1 AS us_iso FROM DATETIME_TBL;
-sixty_two|us_iso
----------+-------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |1997-02-10 17:32:01-08
- |invalid
- |invalid
- |1997-02-10 17:32:01.00-08
- |1997-02-10 17:32:02.00-08
- |1997-02-10 17:32:01.40-08
- |1997-02-10 17:32:01.50-08
- |1997-02-10 17:32:01.60-08
- |1997-01-02 00:00:00-08
- |1997-01-02 03:04:05-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-06-10 17:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:00-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-06-10 18:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-11 17:32:01-08
- |1997-02-12 17:32:01-08
- |1997-02-13 17:32:01-08
- |1997-02-14 17:32:01-08
- |1997-02-15 17:32:01-08
- |1997-02-16 17:32:01-08
- |0097-02-16 17:32 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-08
- |2097-02-16 17:32:01
- |1996-02-28 17:32:01-08
- |1996-02-29 17:32:01-08
- |1996-03-01 17:32:01-08
- |1996-12-30 17:32:01-08
- |1996-12-31 17:32:01-08
- |1997-01-01 17:32:01-08
- |1997-02-28 17:32:01-08
- |1997-03-01 17:32:01-08
- |1997-12-30 17:32:01-08
- |1997-12-31 17:32:01-08
- |1999-12-31 17:32:01-08
- |2000-01-01 17:32:01-08
- |2000-12-31 17:32:01-08
- |2001-01-01 17:32:01-08
- |1957-06-13 00:00:00-07
+SET DateStyle TO 'US,ISO';
+SELECT '' AS sixty_two, d1 AS us_iso FROM DATETIME_TBL;
+ sixty_two | us_iso
+-----------+---------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 1997-02-10 17:32:01-08
+ | invalid
+ | invalid
+ | 1997-02-10 17:32:01.00-08
+ | 1997-02-10 17:32:02.00-08
+ | 1997-02-10 17:32:01.40-08
+ | 1997-02-10 17:32:01.50-08
+ | 1997-02-10 17:32:01.60-08
+ | 1997-01-02 00:00:00-08
+ | 1997-01-02 03:04:05-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-06-10 17:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:00-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-06-10 18:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-11 17:32:01-08
+ | 1997-02-12 17:32:01-08
+ | 1997-02-13 17:32:01-08
+ | 1997-02-14 17:32:01-08
+ | 1997-02-15 17:32:01-08
+ | 1997-02-16 17:32:01-08
+ | 0097-02-16 17:32 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-08
+ | 2097-02-16 17:32:01
+ | 1996-02-28 17:32:01-08
+ | 1996-02-29 17:32:01-08
+ | 1996-03-01 17:32:01-08
+ | 1996-12-30 17:32:01-08
+ | 1996-12-31 17:32:01-08
+ | 1997-01-01 17:32:01-08
+ | 1997-02-28 17:32:01-08
+ | 1997-03-01 17:32:01-08
+ | 1997-12-30 17:32:01-08
+ | 1997-12-31 17:32:01-08
+ | 1999-12-31 17:32:01-08
+ | 2000-01-01 17:32:01-08
+ | 2000-12-31 17:32:01-08
+ | 2001-01-01 17:32:01-08
+ | 1957-06-13 00:00:00-07
(62 rows)
-QUERY: SELECT '' AS eight, f1 AS us_iso FROM ABSTIME_TBL;
-eight|us_iso
------+----------------------
- |1973-01-14 03:14:21-08
- |1995-05-01 00:30:30-07
- |epoch
- |current
- |infinity
- |-infinity
- |1947-05-10 23:59:12-08
- |invalid
+SELECT '' AS eight, f1 AS us_iso FROM ABSTIME_TBL;
+ eight | us_iso
+-------+------------------------
+ | 1973-01-14 03:14:21-08
+ | 1995-05-01 00:30:30-07
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 1947-05-10 23:59:12-08
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'US,SQL';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'US,SQL';
NOTICE: DateStyle is SQL with US (NonEuropean) conventions
-QUERY: SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
-sixty_two|us_sql
----------+--------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |02/10/1997 17:32:01.00 PST
- |invalid
- |invalid
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:02.00 PST
- |02/10/1997 17:32:01.40 PST
- |02/10/1997 17:32:01.50 PST
- |02/10/1997 17:32:01.60 PST
- |01/02/1997 00:00:00.00 PST
- |01/02/1997 03:04:05.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |06/10/1997 17:32:01.00 PDT
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:00.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 17:32:01.00 PST
- |02/10/1997 09:32:01.00 PST
- |02/10/1997 09:32:01.00 PST
- |02/10/1997 09:32:01.00 PST
- |06/10/1997 18:32:01.00 PDT
- |02/10/1997 17:32:01.00 PST
- |02/11/1997 17:32:01.00 PST
- |02/12/1997 17:32:01.00 PST
- |02/13/1997 17:32:01.00 PST
- |02/14/1997 17:32:01.00 PST
- |02/15/1997 17:32:01.00 PST
- |02/16/1997 17:32:01.00 PST
- |02/16/0097 17:32 BC
- |02/16/0097 17:32:01.00
- |02/16/0597 17:32:01.00
- |02/16/1097 17:32:01.00
- |02/16/1697 17:32:01.00
- |02/16/1797 17:32:01.00
- |02/16/1897 17:32:01.00
- |02/16/1997 17:32:01.00 PST
- |02/16/2097 17:32:01.00
- |02/28/1996 17:32:01.00 PST
- |02/29/1996 17:32:01.00 PST
- |03/01/1996 17:32:01.00 PST
- |12/30/1996 17:32:01.00 PST
- |12/31/1996 17:32:01.00 PST
- |01/01/1997 17:32:01.00 PST
- |02/28/1997 17:32:01.00 PST
- |03/01/1997 17:32:01.00 PST
- |12/30/1997 17:32:01.00 PST
- |12/31/1997 17:32:01.00 PST
- |12/31/1999 17:32:01.00 PST
- |01/01/2000 17:32:01.00 PST
- |12/31/2000 17:32:01.00 PST
- |01/01/2001 17:32:01.00 PST
- |06/13/1957 00:00:00.00 PDT
+SHOW DateStyle;
+SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
+ sixty_two | us_sql
+-----------+----------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 02/10/1997 17:32:01.00 PST
+ | invalid
+ | invalid
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:02.00 PST
+ | 02/10/1997 17:32:01.40 PST
+ | 02/10/1997 17:32:01.50 PST
+ | 02/10/1997 17:32:01.60 PST
+ | 01/02/1997 00:00:00.00 PST
+ | 01/02/1997 03:04:05.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 06/10/1997 17:32:01.00 PDT
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:00.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 17:32:01.00 PST
+ | 02/10/1997 09:32:01.00 PST
+ | 02/10/1997 09:32:01.00 PST
+ | 02/10/1997 09:32:01.00 PST
+ | 06/10/1997 18:32:01.00 PDT
+ | 02/10/1997 17:32:01.00 PST
+ | 02/11/1997 17:32:01.00 PST
+ | 02/12/1997 17:32:01.00 PST
+ | 02/13/1997 17:32:01.00 PST
+ | 02/14/1997 17:32:01.00 PST
+ | 02/15/1997 17:32:01.00 PST
+ | 02/16/1997 17:32:01.00 PST
+ | 02/16/0097 17:32 BC
+ | 02/16/0097 17:32:01.00
+ | 02/16/0597 17:32:01.00
+ | 02/16/1097 17:32:01.00
+ | 02/16/1697 17:32:01.00
+ | 02/16/1797 17:32:01.00
+ | 02/16/1897 17:32:01.00
+ | 02/16/1997 17:32:01.00 PST
+ | 02/16/2097 17:32:01.00
+ | 02/28/1996 17:32:01.00 PST
+ | 02/29/1996 17:32:01.00 PST
+ | 03/01/1996 17:32:01.00 PST
+ | 12/30/1996 17:32:01.00 PST
+ | 12/31/1996 17:32:01.00 PST
+ | 01/01/1997 17:32:01.00 PST
+ | 02/28/1997 17:32:01.00 PST
+ | 03/01/1997 17:32:01.00 PST
+ | 12/30/1997 17:32:01.00 PST
+ | 12/31/1997 17:32:01.00 PST
+ | 12/31/1999 17:32:01.00 PST
+ | 01/01/2000 17:32:01.00 PST
+ | 12/31/2000 17:32:01.00 PST
+ | 01/01/2001 17:32:01.00 PST
+ | 06/13/1957 00:00:00.00 PDT
(62 rows)
-QUERY: SELECT '' AS eight, f1 AS us_sql FROM ABSTIME_TBL;
-eight|us_sql
------+--------------------------
- |01/14/1973 03:14:21.00 PST
- |05/01/1995 00:30:30.00 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |05/10/1947 23:59:12.00 PST
- |invalid
+SELECT '' AS eight, f1 AS us_sql FROM ABSTIME_TBL;
+ eight | us_sql
+-------+----------------------------
+ | 01/14/1973 03:14:21.00 PST
+ | 05/01/1995 00:30:30.00 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 05/10/1947 23:59:12.00 PST
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'European,Postgres';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'European,Postgres';
NOTICE: DateStyle is Postgres with European conventions
-QUERY: INSERT INTO DATETIME_TBL VALUES('13/06/1957');
-QUERY: SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
-one
----
- 2
+SHOW DateStyle;
+INSERT INTO DATETIME_TBL VALUES('13/06/1957');
+SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
+ one
+-----
+ 2
(1 row)
-QUERY: SELECT '' AS sixty_three, d1 AS european_postgres FROM DATETIME_TBL;
-sixty_three|european_postgres
------------+-------------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |Mon 10 Feb 17:32:01 1997 PST
- |invalid
- |invalid
- |Mon 10 Feb 17:32:01.00 1997 PST
- |Mon 10 Feb 17:32:02.00 1997 PST
- |Mon 10 Feb 17:32:01.40 1997 PST
- |Mon 10 Feb 17:32:01.50 1997 PST
- |Mon 10 Feb 17:32:01.60 1997 PST
- |Thu 02 Jan 00:00:00 1997 PST
- |Thu 02 Jan 03:04:05 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Tue 10 Jun 17:32:01 1997 PDT
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:00 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 17:32:01 1997 PST
- |Mon 10 Feb 09:32:01 1997 PST
- |Mon 10 Feb 09:32:01 1997 PST
- |Mon 10 Feb 09:32:01 1997 PST
- |Tue 10 Jun 18:32:01 1997 PDT
- |Mon 10 Feb 17:32:01 1997 PST
- |Tue 11 Feb 17:32:01 1997 PST
- |Wed 12 Feb 17:32:01 1997 PST
- |Thu 13 Feb 17:32:01 1997 PST
- |Fri 14 Feb 17:32:01 1997 PST
- |Sat 15 Feb 17:32:01 1997 PST
- |Sun 16 Feb 17:32:01 1997 PST
- |Tue 16 Feb 17:32 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 PST
- |Sat 16 Feb 17:32:01 2097
- |Wed 28 Feb 17:32:01 1996 PST
- |Thu 29 Feb 17:32:01 1996 PST
- |Fri 01 Mar 17:32:01 1996 PST
- |Mon 30 Dec 17:32:01 1996 PST
- |Tue 31 Dec 17:32:01 1996 PST
- |Wed 01 Jan 17:32:01 1997 PST
- |Fri 28 Feb 17:32:01 1997 PST
- |Sat 01 Mar 17:32:01 1997 PST
- |Tue 30 Dec 17:32:01 1997 PST
- |Wed 31 Dec 17:32:01 1997 PST
- |Fri 31 Dec 17:32:01 1999 PST
- |Sat 01 Jan 17:32:01 2000 PST
- |Sun 31 Dec 17:32:01 2000 PST
- |Mon 01 Jan 17:32:01 2001 PST
- |Thu 13 Jun 00:00:00 1957 PDT
- |Thu 13 Jun 00:00:00 1957 PDT
+SELECT '' AS sixty_three, d1 AS european_postgres FROM DATETIME_TBL;
+ sixty_three | european_postgres
+-------------+---------------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | Mon 10 Feb 17:32:01 1997 PST
+ | invalid
+ | invalid
+ | Mon 10 Feb 17:32:01.00 1997 PST
+ | Mon 10 Feb 17:32:02.00 1997 PST
+ | Mon 10 Feb 17:32:01.40 1997 PST
+ | Mon 10 Feb 17:32:01.50 1997 PST
+ | Mon 10 Feb 17:32:01.60 1997 PST
+ | Thu 02 Jan 00:00:00 1997 PST
+ | Thu 02 Jan 03:04:05 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Tue 10 Jun 17:32:01 1997 PDT
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:00 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Mon 10 Feb 09:32:01 1997 PST
+ | Mon 10 Feb 09:32:01 1997 PST
+ | Mon 10 Feb 09:32:01 1997 PST
+ | Tue 10 Jun 18:32:01 1997 PDT
+ | Mon 10 Feb 17:32:01 1997 PST
+ | Tue 11 Feb 17:32:01 1997 PST
+ | Wed 12 Feb 17:32:01 1997 PST
+ | Thu 13 Feb 17:32:01 1997 PST
+ | Fri 14 Feb 17:32:01 1997 PST
+ | Sat 15 Feb 17:32:01 1997 PST
+ | Sun 16 Feb 17:32:01 1997 PST
+ | Tue 16 Feb 17:32 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 PST
+ | Sat 16 Feb 17:32:01 2097
+ | Wed 28 Feb 17:32:01 1996 PST
+ | Thu 29 Feb 17:32:01 1996 PST
+ | Fri 01 Mar 17:32:01 1996 PST
+ | Mon 30 Dec 17:32:01 1996 PST
+ | Tue 31 Dec 17:32:01 1996 PST
+ | Wed 01 Jan 17:32:01 1997 PST
+ | Fri 28 Feb 17:32:01 1997 PST
+ | Sat 01 Mar 17:32:01 1997 PST
+ | Tue 30 Dec 17:32:01 1997 PST
+ | Wed 31 Dec 17:32:01 1997 PST
+ | Fri 31 Dec 17:32:01 1999 PST
+ | Sat 01 Jan 17:32:01 2000 PST
+ | Sun 31 Dec 17:32:01 2000 PST
+ | Mon 01 Jan 17:32:01 2001 PST
+ | Thu 13 Jun 00:00:00 1957 PDT
+ | Thu 13 Jun 00:00:00 1957 PDT
(63 rows)
-QUERY: SELECT '' AS eight, f1 AS european_postgres FROM ABSTIME_TBL;
-eight|european_postgres
------+----------------------------
- |Sun 14 Jan 03:14:21 1973 PST
- |Mon 01 May 00:30:30 1995 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |Sat 10 May 23:59:12 1947 PST
- |invalid
+SELECT '' AS eight, f1 AS european_postgres FROM ABSTIME_TBL;
+ eight | european_postgres
+-------+------------------------------
+ | Sun 14 Jan 03:14:21 1973 PST
+ | Mon 01 May 00:30:30 1995 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | Sat 10 May 23:59:12 1947 PST
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'European,ISO';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'European,ISO';
NOTICE: DateStyle is ISO with European conventions
-QUERY: SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
-sixty_three|european_iso
------------+-------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |1997-02-10 17:32:01-08
- |invalid
- |invalid
- |1997-02-10 17:32:01.00-08
- |1997-02-10 17:32:02.00-08
- |1997-02-10 17:32:01.40-08
- |1997-02-10 17:32:01.50-08
- |1997-02-10 17:32:01.60-08
- |1997-01-02 00:00:00-08
- |1997-01-02 03:04:05-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-06-10 17:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:00-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 17:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-02-10 09:32:01-08
- |1997-06-10 18:32:01-07
- |1997-02-10 17:32:01-08
- |1997-02-11 17:32:01-08
- |1997-02-12 17:32:01-08
- |1997-02-13 17:32:01-08
- |1997-02-14 17:32:01-08
- |1997-02-15 17:32:01-08
- |1997-02-16 17:32:01-08
- |0097-02-16 17:32 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-08
- |2097-02-16 17:32:01
- |1996-02-28 17:32:01-08
- |1996-02-29 17:32:01-08
- |1996-03-01 17:32:01-08
- |1996-12-30 17:32:01-08
- |1996-12-31 17:32:01-08
- |1997-01-01 17:32:01-08
- |1997-02-28 17:32:01-08
- |1997-03-01 17:32:01-08
- |1997-12-30 17:32:01-08
- |1997-12-31 17:32:01-08
- |1999-12-31 17:32:01-08
- |2000-01-01 17:32:01-08
- |2000-12-31 17:32:01-08
- |2001-01-01 17:32:01-08
- |1957-06-13 00:00:00-07
- |1957-06-13 00:00:00-07
+SHOW DateStyle;
+SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
+ sixty_three | european_iso
+-------------+---------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 1997-02-10 17:32:01-08
+ | invalid
+ | invalid
+ | 1997-02-10 17:32:01.00-08
+ | 1997-02-10 17:32:02.00-08
+ | 1997-02-10 17:32:01.40-08
+ | 1997-02-10 17:32:01.50-08
+ | 1997-02-10 17:32:01.60-08
+ | 1997-01-02 00:00:00-08
+ | 1997-01-02 03:04:05-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-06-10 17:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:00-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 17:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-02-10 09:32:01-08
+ | 1997-06-10 18:32:01-07
+ | 1997-02-10 17:32:01-08
+ | 1997-02-11 17:32:01-08
+ | 1997-02-12 17:32:01-08
+ | 1997-02-13 17:32:01-08
+ | 1997-02-14 17:32:01-08
+ | 1997-02-15 17:32:01-08
+ | 1997-02-16 17:32:01-08
+ | 0097-02-16 17:32 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-08
+ | 2097-02-16 17:32:01
+ | 1996-02-28 17:32:01-08
+ | 1996-02-29 17:32:01-08
+ | 1996-03-01 17:32:01-08
+ | 1996-12-30 17:32:01-08
+ | 1996-12-31 17:32:01-08
+ | 1997-01-01 17:32:01-08
+ | 1997-02-28 17:32:01-08
+ | 1997-03-01 17:32:01-08
+ | 1997-12-30 17:32:01-08
+ | 1997-12-31 17:32:01-08
+ | 1999-12-31 17:32:01-08
+ | 2000-01-01 17:32:01-08
+ | 2000-12-31 17:32:01-08
+ | 2001-01-01 17:32:01-08
+ | 1957-06-13 00:00:00-07
+ | 1957-06-13 00:00:00-07
(63 rows)
-QUERY: SELECT '' AS eight, f1 AS european_iso FROM ABSTIME_TBL;
-eight|european_iso
------+----------------------
- |1973-01-14 03:14:21-08
- |1995-05-01 00:30:30-07
- |epoch
- |current
- |infinity
- |-infinity
- |1947-05-10 23:59:12-08
- |invalid
+SELECT '' AS eight, f1 AS european_iso FROM ABSTIME_TBL;
+ eight | european_iso
+-------+------------------------
+ | 1973-01-14 03:14:21-08
+ | 1995-05-01 00:30:30-07
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 1947-05-10 23:59:12-08
+ | invalid
(8 rows)
-QUERY: SET DateStyle TO 'European,SQL';
-QUERY: SHOW DateStyle;
+SET DateStyle TO 'European,SQL';
NOTICE: DateStyle is SQL with European conventions
-QUERY: SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
-sixty_three|european_sql
------------+--------------------------
- |invalid
- |-infinity
- |infinity
- |epoch
- |10/02/1997 17:32:01.00 PST
- |invalid
- |invalid
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:02.00 PST
- |10/02/1997 17:32:01.40 PST
- |10/02/1997 17:32:01.50 PST
- |10/02/1997 17:32:01.60 PST
- |02/01/1997 00:00:00.00 PST
- |02/01/1997 03:04:05.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/06/1997 17:32:01.00 PDT
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:00.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 17:32:01.00 PST
- |10/02/1997 09:32:01.00 PST
- |10/02/1997 09:32:01.00 PST
- |10/02/1997 09:32:01.00 PST
- |10/06/1997 18:32:01.00 PDT
- |10/02/1997 17:32:01.00 PST
- |11/02/1997 17:32:01.00 PST
- |12/02/1997 17:32:01.00 PST
- |13/02/1997 17:32:01.00 PST
- |14/02/1997 17:32:01.00 PST
- |15/02/1997 17:32:01.00 PST
- |16/02/1997 17:32:01.00 PST
- |16/02/0097 17:32 BC
- |16/02/0097 17:32:01.00
- |16/02/0597 17:32:01.00
- |16/02/1097 17:32:01.00
- |16/02/1697 17:32:01.00
- |16/02/1797 17:32:01.00
- |16/02/1897 17:32:01.00
- |16/02/1997 17:32:01.00 PST
- |16/02/2097 17:32:01.00
- |28/02/1996 17:32:01.00 PST
- |29/02/1996 17:32:01.00 PST
- |01/03/1996 17:32:01.00 PST
- |30/12/1996 17:32:01.00 PST
- |31/12/1996 17:32:01.00 PST
- |01/01/1997 17:32:01.00 PST
- |28/02/1997 17:32:01.00 PST
- |01/03/1997 17:32:01.00 PST
- |30/12/1997 17:32:01.00 PST
- |31/12/1997 17:32:01.00 PST
- |31/12/1999 17:32:01.00 PST
- |01/01/2000 17:32:01.00 PST
- |31/12/2000 17:32:01.00 PST
- |01/01/2001 17:32:01.00 PST
- |13/06/1957 00:00:00.00 PDT
- |13/06/1957 00:00:00.00 PDT
+SHOW DateStyle;
+SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
+ sixty_three | european_sql
+-------------+----------------------------
+ | invalid
+ | -infinity
+ | infinity
+ | epoch
+ | 10/02/1997 17:32:01.00 PST
+ | invalid
+ | invalid
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:02.00 PST
+ | 10/02/1997 17:32:01.40 PST
+ | 10/02/1997 17:32:01.50 PST
+ | 10/02/1997 17:32:01.60 PST
+ | 02/01/1997 00:00:00.00 PST
+ | 02/01/1997 03:04:05.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/06/1997 17:32:01.00 PDT
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:00.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 17:32:01.00 PST
+ | 10/02/1997 09:32:01.00 PST
+ | 10/02/1997 09:32:01.00 PST
+ | 10/02/1997 09:32:01.00 PST
+ | 10/06/1997 18:32:01.00 PDT
+ | 10/02/1997 17:32:01.00 PST
+ | 11/02/1997 17:32:01.00 PST
+ | 12/02/1997 17:32:01.00 PST
+ | 13/02/1997 17:32:01.00 PST
+ | 14/02/1997 17:32:01.00 PST
+ | 15/02/1997 17:32:01.00 PST
+ | 16/02/1997 17:32:01.00 PST
+ | 16/02/0097 17:32 BC
+ | 16/02/0097 17:32:01.00
+ | 16/02/0597 17:32:01.00
+ | 16/02/1097 17:32:01.00
+ | 16/02/1697 17:32:01.00
+ | 16/02/1797 17:32:01.00
+ | 16/02/1897 17:32:01.00
+ | 16/02/1997 17:32:01.00 PST
+ | 16/02/2097 17:32:01.00
+ | 28/02/1996 17:32:01.00 PST
+ | 29/02/1996 17:32:01.00 PST
+ | 01/03/1996 17:32:01.00 PST
+ | 30/12/1996 17:32:01.00 PST
+ | 31/12/1996 17:32:01.00 PST
+ | 01/01/1997 17:32:01.00 PST
+ | 28/02/1997 17:32:01.00 PST
+ | 01/03/1997 17:32:01.00 PST
+ | 30/12/1997 17:32:01.00 PST
+ | 31/12/1997 17:32:01.00 PST
+ | 31/12/1999 17:32:01.00 PST
+ | 01/01/2000 17:32:01.00 PST
+ | 31/12/2000 17:32:01.00 PST
+ | 01/01/2001 17:32:01.00 PST
+ | 13/06/1957 00:00:00.00 PDT
+ | 13/06/1957 00:00:00.00 PDT
(63 rows)
-QUERY: SELECT '' AS eight, f1 AS european_sql FROM ABSTIME_TBL;
-eight|european_sql
------+--------------------------
- |14/01/1973 03:14:21.00 PST
- |01/05/1995 00:30:30.00 PDT
- |epoch
- |current
- |infinity
- |-infinity
- |10/05/1947 23:59:12.00 PST
- |invalid
+SELECT '' AS eight, f1 AS european_sql FROM ABSTIME_TBL;
+ eight | european_sql
+-------+----------------------------
+ | 14/01/1973 03:14:21.00 PST
+ | 01/05/1995 00:30:30.00 PDT
+ | epoch
+ | current
+ | infinity
+ | -infinity
+ | 10/05/1947 23:59:12.00 PST
+ | invalid
(8 rows)
-QUERY: RESET DateStyle;
-QUERY: SHOW DateStyle;
+RESET DateStyle;
NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
+SHOW DateStyle;
-QUERY: DROP TABLE INET_TBL;
+--
+-- INET
+--
+-- prepare the table...
+DROP TABLE INET_TBL;
ERROR: Relation 'inet_tbl' does not exist
-QUERY: CREATE TABLE INET_TBL (c cidr, i inet);
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/24', '192.168.1.226');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.0.0.0', '10.1.2.3/8');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.1.2.3', '10.1.2.3/32');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.1.2', '10.1.2.3/24');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.1', '10.1.2.3/16');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10', '11.1.2.3/8');
-QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10', '9.1.2.3/8');
-QUERY: SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL;
-ten|cidr |inet
----+------------+----------------
- |192.168.1/24|192.168.1.226/24
- |192.168.1/24|192.168.1.226
- |10/8 |10.1.2.3/8
- |10.0.0.0/32 |10.1.2.3/8
- |10.1.2.3/32 |10.1.2.3
- |10.1.2/24 |10.1.2.3/24
- |10.1/16 |10.1.2.3/16
- |10/8 |10.1.2.3/8
- |10/8 |11.1.2.3/8
- |10/8 |9.1.2.3/8
+CREATE TABLE INET_TBL (c cidr, i inet);
+INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24');
+INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/24', '192.168.1.226');
+INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
+INSERT INTO INET_TBL (c, i) VALUES ('10.0.0.0', '10.1.2.3/8');
+INSERT INTO INET_TBL (c, i) VALUES ('10.1.2.3', '10.1.2.3/32');
+INSERT INTO INET_TBL (c, i) VALUES ('10.1.2', '10.1.2.3/24');
+INSERT INTO INET_TBL (c, i) VALUES ('10.1', '10.1.2.3/16');
+INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
+INSERT INTO INET_TBL (c, i) VALUES ('10', '11.1.2.3/8');
+INSERT INTO INET_TBL (c, i) VALUES ('10', '9.1.2.3/8');
+SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL;
+ ten | cidr | inet
+-----+--------------+------------------
+ | 192.168.1/24 | 192.168.1.226/24
+ | 192.168.1/24 | 192.168.1.226
+ | 10/8 | 10.1.2.3/8
+ | 10.0.0.0/32 | 10.1.2.3/8
+ | 10.1.2.3/32 | 10.1.2.3
+ | 10.1.2/24 | 10.1.2.3/24
+ | 10.1/16 | 10.1.2.3/16
+ | 10/8 | 10.1.2.3/8
+ | 10/8 | 11.1.2.3/8
+ | 10/8 | 9.1.2.3/8
(10 rows)
-QUERY: SELECT '' AS ten, i AS inet, host(i) FROM INET_TBL;
-ten|inet | host
----+----------------+-------------
- |192.168.1.226/24|192.168.1.226
- |192.168.1.226 |192.168.1.226
- |10.1.2.3/8 | 10.1.2.3
- |10.1.2.3/8 | 10.1.2.3
- |10.1.2.3 | 10.1.2.3
- |10.1.2.3/24 | 10.1.2.3
- |10.1.2.3/16 | 10.1.2.3
- |10.1.2.3/8 | 10.1.2.3
- |11.1.2.3/8 | 11.1.2.3
- |9.1.2.3/8 | 9.1.2.3
+-- now test some support functions
+SELECT '' AS ten, i AS inet, host(i) FROM INET_TBL;
+ ten | inet | host
+-----+------------------+---------------
+ | 192.168.1.226/24 | 192.168.1.226
+ | 192.168.1.226 | 192.168.1.226
+ | 10.1.2.3/8 | 10.1.2.3
+ | 10.1.2.3/8 | 10.1.2.3
+ | 10.1.2.3 | 10.1.2.3
+ | 10.1.2.3/24 | 10.1.2.3
+ | 10.1.2.3/16 | 10.1.2.3
+ | 10.1.2.3/8 | 10.1.2.3
+ | 11.1.2.3/8 | 11.1.2.3
+ | 9.1.2.3/8 | 9.1.2.3
(10 rows)
-QUERY: SELECT '' AS ten, c AS cidr, broadcast(c),
+SELECT '' AS ten, c AS cidr, broadcast(c),
i AS inet, broadcast(i) FROM INET_TBL;
-ten|cidr | broadcast|inet | broadcast
----+------------+---------------+----------------+---------------
- |192.168.1/24| 192.168.1.255|192.168.1.226/24| 192.168.1.255
- |192.168.1/24| 192.168.1.255|192.168.1.226 |255.255.255.255
- |10/8 | 10.255.255.255|10.1.2.3/8 | 10.255.255.255
- |10.0.0.0/32 |255.255.255.255|10.1.2.3/8 | 10.255.255.255
- |10.1.2.3/32 |255.255.255.255|10.1.2.3 |255.255.255.255
- |10.1.2/24 | 10.1.2.255|10.1.2.3/24 | 10.1.2.255
- |10.1/16 | 10.1.255.255|10.1.2.3/16 | 10.1.255.255
- |10/8 | 10.255.255.255|10.1.2.3/8 | 10.255.255.255
- |10/8 | 10.255.255.255|11.1.2.3/8 | 11.255.255.255
- |10/8 | 10.255.255.255|9.1.2.3/8 | 9.255.255.255
+ ten | cidr | broadcast | inet | broadcast
+-----+--------------+-----------------+------------------+-----------------
+ | 192.168.1/24 | 192.168.1.255 | 192.168.1.226/24 | 192.168.1.255
+ | 192.168.1/24 | 192.168.1.255 | 192.168.1.226 | 255.255.255.255
+ | 10/8 | 10.255.255.255 | 10.1.2.3/8 | 10.255.255.255
+ | 10.0.0.0/32 | 255.255.255.255 | 10.1.2.3/8 | 10.255.255.255
+ | 10.1.2.3/32 | 255.255.255.255 | 10.1.2.3 | 255.255.255.255
+ | 10.1.2/24 | 10.1.2.255 | 10.1.2.3/24 | 10.1.2.255
+ | 10.1/16 | 10.1.255.255 | 10.1.2.3/16 | 10.1.255.255
+ | 10/8 | 10.255.255.255 | 10.1.2.3/8 | 10.255.255.255
+ | 10/8 | 10.255.255.255 | 11.1.2.3/8 | 11.255.255.255
+ | 10/8 | 10.255.255.255 | 9.1.2.3/8 | 9.255.255.255
(10 rows)
-QUERY: SELECT '' AS ten, c AS cidr, network(c) AS "network(cidr)",
+SELECT '' AS ten, c AS cidr, network(c) AS "network(cidr)",
i AS inet, network(i) AS "network(inet)" FROM INET_TBL;
-ten|cidr |network(cidr)|inet |network(inet)
----+------------+-------------+----------------+----------------
- |192.168.1/24|192.168.1/24 |192.168.1.226/24|192.168.1/24
- |192.168.1/24|192.168.1/24 |192.168.1.226 |192.168.1.226/32
- |10/8 |10/8 |10.1.2.3/8 |10/8
- |10.0.0.0/32 |10.0.0.0/32 |10.1.2.3/8 |10/8
- |10.1.2.3/32 |10.1.2.3/32 |10.1.2.3 |10.1.2.3/32
- |10.1.2/24 |10.1.2/24 |10.1.2.3/24 |10.1.2/24
- |10.1/16 |10.1/16 |10.1.2.3/16 |10.1/16
- |10/8 |10/8 |10.1.2.3/8 |10/8
- |10/8 |10/8 |11.1.2.3/8 |11/8
- |10/8 |10/8 |9.1.2.3/8 |9/8
+ ten | cidr | network(cidr) | inet | network(inet)
+-----+--------------+---------------+------------------+------------------
+ | 192.168.1/24 | 192.168.1/24 | 192.168.1.226/24 | 192.168.1/24
+ | 192.168.1/24 | 192.168.1/24 | 192.168.1.226 | 192.168.1.226/32
+ | 10/8 | 10/8 | 10.1.2.3/8 | 10/8
+ | 10.0.0.0/32 | 10.0.0.0/32 | 10.1.2.3/8 | 10/8
+ | 10.1.2.3/32 | 10.1.2.3/32 | 10.1.2.3 | 10.1.2.3/32
+ | 10.1.2/24 | 10.1.2/24 | 10.1.2.3/24 | 10.1.2/24
+ | 10.1/16 | 10.1/16 | 10.1.2.3/16 | 10.1/16
+ | 10/8 | 10/8 | 10.1.2.3/8 | 10/8
+ | 10/8 | 10/8 | 11.1.2.3/8 | 11/8
+ | 10/8 | 10/8 | 9.1.2.3/8 | 9/8
(10 rows)
-QUERY: SELECT '' AS ten, c AS cidr, masklen(c) AS "masklen(cidr)",
+SELECT '' AS ten, c AS cidr, masklen(c) AS "masklen(cidr)",
i AS inet, masklen(i) AS "masklen(inet)" FROM INET_TBL;
-ten|cidr |masklen(cidr)|inet |masklen(inet)
----+------------+-------------+----------------+-------------
- |192.168.1/24| 24|192.168.1.226/24| 24
- |192.168.1/24| 24|192.168.1.226 | 32
- |10/8 | 8|10.1.2.3/8 | 8
- |10.0.0.0/32 | 32|10.1.2.3/8 | 8
- |10.1.2.3/32 | 32|10.1.2.3 | 32
- |10.1.2/24 | 24|10.1.2.3/24 | 24
- |10.1/16 | 16|10.1.2.3/16 | 16
- |10/8 | 8|10.1.2.3/8 | 8
- |10/8 | 8|11.1.2.3/8 | 8
- |10/8 | 8|9.1.2.3/8 | 8
+ ten | cidr | masklen(cidr) | inet | masklen(inet)
+-----+--------------+---------------+------------------+---------------
+ | 192.168.1/24 | 24 | 192.168.1.226/24 | 24
+ | 192.168.1/24 | 24 | 192.168.1.226 | 32
+ | 10/8 | 8 | 10.1.2.3/8 | 8
+ | 10.0.0.0/32 | 32 | 10.1.2.3/8 | 8
+ | 10.1.2.3/32 | 32 | 10.1.2.3 | 32
+ | 10.1.2/24 | 24 | 10.1.2.3/24 | 24
+ | 10.1/16 | 16 | 10.1.2.3/16 | 16
+ | 10/8 | 8 | 10.1.2.3/8 | 8
+ | 10/8 | 8 | 11.1.2.3/8 | 8
+ | 10/8 | 8 | 9.1.2.3/8 | 8
(10 rows)
-QUERY: SELECT '' AS four, c AS cidr, masklen(c) AS "masklen(cidr)",
+SELECT '' AS four, c AS cidr, masklen(c) AS "masklen(cidr)",
i AS inet, masklen(i) AS "masklen(inet)" FROM INET_TBL
WHERE masklen(c) <= 8;
-four|cidr|masklen(cidr)|inet |masklen(inet)
-----+----+-------------+----------+-------------
- |10/8| 8|10.1.2.3/8| 8
- |10/8| 8|10.1.2.3/8| 8
- |10/8| 8|11.1.2.3/8| 8
- |10/8| 8|9.1.2.3/8 | 8
+ four | cidr | masklen(cidr) | inet | masklen(inet)
+------+------+---------------+------------+---------------
+ | 10/8 | 8 | 10.1.2.3/8 | 8
+ | 10/8 | 8 | 10.1.2.3/8 | 8
+ | 10/8 | 8 | 11.1.2.3/8 | 8
+ | 10/8 | 8 | 9.1.2.3/8 | 8
(4 rows)
-QUERY: SELECT '' AS six, c AS cidr, i AS inet FROM INET_TBL
+SELECT '' AS six, c AS cidr, i AS inet FROM INET_TBL
WHERE c = i;
-six|cidr |inet
----+------------+----------------
- |192.168.1/24|192.168.1.226/24
- |10/8 |10.1.2.3/8
- |10.1.2.3/32 |10.1.2.3
- |10.1.2/24 |10.1.2.3/24
- |10.1/16 |10.1.2.3/16
- |10/8 |10.1.2.3/8
+ six | cidr | inet
+-----+--------------+------------------
+ | 192.168.1/24 | 192.168.1.226/24
+ | 10/8 | 10.1.2.3/8
+ | 10.1.2.3/32 | 10.1.2.3
+ | 10.1.2/24 | 10.1.2.3/24
+ | 10.1/16 | 10.1.2.3/16
+ | 10/8 | 10.1.2.3/8
(6 rows)
-QUERY: SELECT '' AS ten, i, c,
- i < c AS lt, i <= c AS le, i = c AS eq,
+SELECT '' AS ten, i, c,
+ i < c AS lt, i <= c AS le, i = c AS eq,
i >= c AS ge, i > c AS gt, i <> c AS ne,
i << c AS sb, i <<= c AS sbe,
i >> c AS sup, i >>= c AS spe
FROM INET_TBL;
-ten|i |c |lt|le|eq|ge|gt|ne|sb|sbe|sup|spe
----+----------------+------------+--+--+--+--+--+--+--+---+---+---
- |192.168.1.226/24|192.168.1/24|f |t |t |t |f |f |f |t |f |t
- |192.168.1.226 |192.168.1/24|f |f |f |t |t |t |t |t |f |f
- |10.1.2.3/8 |10/8 |f |t |t |t |f |f |f |t |f |t
- |10.1.2.3/8 |10.0.0.0/32 |f |f |f |t |t |t |f |f |t |t
- |10.1.2.3 |10.1.2.3/32 |f |t |t |t |f |f |f |t |f |t
- |10.1.2.3/24 |10.1.2/24 |f |t |t |t |f |f |f |t |f |t
- |10.1.2.3/16 |10.1/16 |f |t |t |t |f |f |f |t |f |t
- |10.1.2.3/8 |10/8 |f |t |t |t |f |f |f |t |f |t
- |11.1.2.3/8 |10/8 |f |f |f |t |t |t |f |f |f |f
- |9.1.2.3/8 |10/8 |t |t |f |f |f |t |f |f |f |f
+ ten | i | c | lt | le | eq | ge | gt | ne | sb | sbe | sup | spe
+-----+------------------+--------------+----+----+----+----+----+----+----+-----+-----+-----
+ | 192.168.1.226/24 | 192.168.1/24 | f | t | t | t | f | f | f | t | f | t
+ | 192.168.1.226 | 192.168.1/24 | f | f | f | t | t | t | t | t | f | f
+ | 10.1.2.3/8 | 10/8 | f | t | t | t | f | f | f | t | f | t
+ | 10.1.2.3/8 | 10.0.0.0/32 | f | f | f | t | t | t | f | f | t | t
+ | 10.1.2.3 | 10.1.2.3/32 | f | t | t | t | f | f | f | t | f | t
+ | 10.1.2.3/24 | 10.1.2/24 | f | t | t | t | f | f | f | t | f | t
+ | 10.1.2.3/16 | 10.1/16 | f | t | t | t | f | f | f | t | f | t
+ | 10.1.2.3/8 | 10/8 | f | t | t | t | f | f | f | t | f | t
+ | 11.1.2.3/8 | 10/8 | f | f | f | t | t | t | f | f | f | f
+ | 9.1.2.3/8 | 10/8 | t | t | f | f | f | t | f | f | f | f
(10 rows)
-QUERY: CREATE TABLE LSEG_TBL (s lseg);
-QUERY: INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)]');
-QUERY: INSERT INTO LSEG_TBL VALUES ('(0,0),(6,6)');
-QUERY: INSERT INTO LSEG_TBL VALUES ('10,-10 ,-3,-4');
-QUERY: INSERT INTO LSEG_TBL VALUES ('[-1e6,2e2,3e5, -4e1]');
-QUERY: INSERT INTO LSEG_TBL VALUES ('(11,22,33,44)');
-QUERY: INSERT INTO LSEG_TBL VALUES ('(3asdf,2 ,3,4r2)');
+--
+-- LSEG
+-- Line segments
+--
+--DROP TABLE LSEG_TBL;
+CREATE TABLE LSEG_TBL (s lseg);
+INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)]');
+INSERT INTO LSEG_TBL VALUES ('(0,0),(6,6)');
+INSERT INTO LSEG_TBL VALUES ('10,-10 ,-3,-4');
+INSERT INTO LSEG_TBL VALUES ('[-1e6,2e2,3e5, -4e1]');
+INSERT INTO LSEG_TBL VALUES ('(11,22,33,44)');
+-- bad values for parser testing
+INSERT INTO LSEG_TBL VALUES ('(3asdf,2 ,3,4r2)');
ERROR: Bad lseg external representation '(3asdf,2 ,3,4r2)'
-QUERY: INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4');
+INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4');
ERROR: Bad lseg external representation '[1,2,3, 4'
-QUERY: INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]');
+INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]');
ERROR: Bad lseg external representation '[(,2),(3,4)]'
-QUERY: INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)');
+INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)');
ERROR: Bad lseg external representation '[(1,2),(3,4)'
-QUERY: select * from LSEG_TBL;
-s
------------------------------
-[(1,2),(3,4)]
-[(0,0),(6,6)]
-[(10,-10),(-3,-4)]
-[(-1000000,200),(300000,-40)]
-[(11,22),(33,44)]
+select * from LSEG_TBL;
+ s
+-------------------------------
+ [(1,2),(3,4)]
+ [(0,0),(6,6)]
+ [(10,-10),(-3,-4)]
+ [(-1000000,200),(300000,-40)]
+ [(11,22),(33,44)]
(5 rows)
-QUERY: SELECT * FROM LSEG_TBL WHERE s <= '[(1,2),(3,4)]'::lseg;
-s
--------------
-[(1,2),(3,4)]
+SELECT * FROM LSEG_TBL WHERE s <= lseg '[(1,2),(3,4)]';
+ s
+---------------
+ [(1,2),(3,4)]
(1 row)
-QUERY: SELECT * FROM LSEG_TBL WHERE (s <-> '[(1,2),(3,4)]'::lseg) < 10;
-s
-------------------
-[(1,2),(3,4)]
-[(0,0),(6,6)]
-[(10,-10),(-3,-4)]
+SELECT * FROM LSEG_TBL WHERE (s <-> lseg '[(1,2),(3,4)]') < 10;
+ s
+--------------------
+ [(1,2),(3,4)]
+ [(0,0),(6,6)]
+ [(10,-10),(-3,-4)]
(3 rows)
-QUERY: CREATE TABLE num_data (id int4, val numeric(210,10));
-QUERY: CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_exp_sqrt (id int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_exp_ln (id int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_exp_log10 (id int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_exp_power_10_ln (id int4, expected numeric(210,10));
-QUERY: CREATE TABLE num_result (id1 int4, id2 int4, result numeric(210,10));
-QUERY: BEGIN TRANSACTION;
-QUERY: INSERT INTO num_exp_add VALUES (0,0,'0');
-QUERY: INSERT INTO num_exp_sub VALUES (0,0,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (0,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (0,1,'0');
-QUERY: INSERT INTO num_exp_sub VALUES (0,1,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (0,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (0,2,'-34338492.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (0,2,'34338492.215397047');
-QUERY: INSERT INTO num_exp_mul VALUES (0,2,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,2,'0');
-QUERY: INSERT INTO num_exp_add VALUES (0,3,'4.31');
-QUERY: INSERT INTO num_exp_sub VALUES (0,3,'-4.31');
-QUERY: INSERT INTO num_exp_mul VALUES (0,3,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,3,'0');
-QUERY: INSERT INTO num_exp_add VALUES (0,4,'7799461.4119');
-QUERY: INSERT INTO num_exp_sub VALUES (0,4,'-7799461.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (0,4,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,4,'0');
-QUERY: INSERT INTO num_exp_add VALUES (0,5,'16397.038491');
-QUERY: INSERT INTO num_exp_sub VALUES (0,5,'-16397.038491');
-QUERY: INSERT INTO num_exp_mul VALUES (0,5,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,5,'0');
-QUERY: INSERT INTO num_exp_add VALUES (0,6,'93901.57763026');
-QUERY: INSERT INTO num_exp_sub VALUES (0,6,'-93901.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (0,6,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,6,'0');
-QUERY: INSERT INTO num_exp_add VALUES (0,7,'-83028485');
-QUERY: INSERT INTO num_exp_sub VALUES (0,7,'83028485');
-QUERY: INSERT INTO num_exp_mul VALUES (0,7,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,7,'0');
-QUERY: INSERT INTO num_exp_add VALUES (0,8,'74881');
-QUERY: INSERT INTO num_exp_sub VALUES (0,8,'-74881');
-QUERY: INSERT INTO num_exp_mul VALUES (0,8,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,8,'0');
-QUERY: INSERT INTO num_exp_add VALUES (0,9,'-24926804.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (0,9,'24926804.045047420');
-QUERY: INSERT INTO num_exp_mul VALUES (0,9,'0');
-QUERY: INSERT INTO num_exp_div VALUES (0,9,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,0,'0');
-QUERY: INSERT INTO num_exp_sub VALUES (1,0,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (1,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (1,1,'0');
-QUERY: INSERT INTO num_exp_sub VALUES (1,1,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (1,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (1,2,'-34338492.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (1,2,'34338492.215397047');
-QUERY: INSERT INTO num_exp_mul VALUES (1,2,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,2,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,3,'4.31');
-QUERY: INSERT INTO num_exp_sub VALUES (1,3,'-4.31');
-QUERY: INSERT INTO num_exp_mul VALUES (1,3,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,3,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,4,'7799461.4119');
-QUERY: INSERT INTO num_exp_sub VALUES (1,4,'-7799461.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (1,4,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,4,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,5,'16397.038491');
-QUERY: INSERT INTO num_exp_sub VALUES (1,5,'-16397.038491');
-QUERY: INSERT INTO num_exp_mul VALUES (1,5,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,5,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,6,'93901.57763026');
-QUERY: INSERT INTO num_exp_sub VALUES (1,6,'-93901.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (1,6,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,6,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,7,'-83028485');
-QUERY: INSERT INTO num_exp_sub VALUES (1,7,'83028485');
-QUERY: INSERT INTO num_exp_mul VALUES (1,7,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,7,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,8,'74881');
-QUERY: INSERT INTO num_exp_sub VALUES (1,8,'-74881');
-QUERY: INSERT INTO num_exp_mul VALUES (1,8,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,8,'0');
-QUERY: INSERT INTO num_exp_add VALUES (1,9,'-24926804.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (1,9,'24926804.045047420');
-QUERY: INSERT INTO num_exp_mul VALUES (1,9,'0');
-QUERY: INSERT INTO num_exp_div VALUES (1,9,'0');
-QUERY: INSERT INTO num_exp_add VALUES (2,0,'-34338492.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (2,0,'-34338492.215397047');
-QUERY: INSERT INTO num_exp_mul VALUES (2,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (2,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (2,1,'-34338492.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (2,1,'-34338492.215397047');
-QUERY: INSERT INTO num_exp_mul VALUES (2,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (2,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (2,2,'-68676984.430794094');
-QUERY: INSERT INTO num_exp_sub VALUES (2,2,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (2,2,'1179132047626883.596862135856320209');
-QUERY: INSERT INTO num_exp_div VALUES (2,2,'1.00000000000000000000');
-QUERY: INSERT INTO num_exp_add VALUES (2,3,'-34338487.905397047');
-QUERY: INSERT INTO num_exp_sub VALUES (2,3,'-34338496.525397047');
-QUERY: INSERT INTO num_exp_mul VALUES (2,3,'-147998901.44836127257');
-QUERY: INSERT INTO num_exp_div VALUES (2,3,'-7967167.56737750510440835266');
-QUERY: INSERT INTO num_exp_add VALUES (2,4,'-26539030.803497047');
-QUERY: INSERT INTO num_exp_sub VALUES (2,4,'-42137953.627297047');
-QUERY: INSERT INTO num_exp_mul VALUES (2,4,'-267821744976817.8111137106593');
-QUERY: INSERT INTO num_exp_div VALUES (2,4,'-4.40267480046830116685');
-QUERY: INSERT INTO num_exp_add VALUES (2,5,'-34322095.176906047');
-QUERY: INSERT INTO num_exp_sub VALUES (2,5,'-34354889.253888047');
-QUERY: INSERT INTO num_exp_mul VALUES (2,5,'-563049578578.769242506736077');
-QUERY: INSERT INTO num_exp_div VALUES (2,5,'-2094.18866914563535496429');
-QUERY: INSERT INTO num_exp_add VALUES (2,6,'-34244590.637766787');
-QUERY: INSERT INTO num_exp_sub VALUES (2,6,'-34432393.793027307');
-QUERY: INSERT INTO num_exp_mul VALUES (2,6,'-3224438592470.18449811926184222');
-QUERY: INSERT INTO num_exp_div VALUES (2,6,'-365.68599891479766440940');
-QUERY: INSERT INTO num_exp_add VALUES (2,7,'-117366977.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (2,7,'48689992.784602953');
-QUERY: INSERT INTO num_exp_mul VALUES (2,7,'2851072985828710.485883795');
-QUERY: INSERT INTO num_exp_div VALUES (2,7,'.41357483778485235518');
-QUERY: INSERT INTO num_exp_add VALUES (2,8,'-34263611.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047');
-QUERY: INSERT INTO num_exp_mul VALUES (2,8,'-2571300635581.146276407');
-QUERY: INSERT INTO num_exp_div VALUES (2,8,'-458.57416721727870888476');
-QUERY: INSERT INTO num_exp_add VALUES (2,9,'-59265296.260444467');
-QUERY: INSERT INTO num_exp_sub VALUES (2,9,'-9411688.170349627');
-QUERY: INSERT INTO num_exp_mul VALUES (2,9,'855948866655588.453741509242968740');
-QUERY: INSERT INTO num_exp_div VALUES (2,9,'1.37757299946438931811');
-QUERY: INSERT INTO num_exp_add VALUES (3,0,'4.31');
-QUERY: INSERT INTO num_exp_sub VALUES (3,0,'4.31');
-QUERY: INSERT INTO num_exp_mul VALUES (3,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (3,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (3,1,'4.31');
-QUERY: INSERT INTO num_exp_sub VALUES (3,1,'4.31');
-QUERY: INSERT INTO num_exp_mul VALUES (3,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (3,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (3,2,'-34338487.905397047');
-QUERY: INSERT INTO num_exp_sub VALUES (3,2,'34338496.525397047');
-QUERY: INSERT INTO num_exp_mul VALUES (3,2,'-147998901.44836127257');
-QUERY: INSERT INTO num_exp_div VALUES (3,2,'-.00000012551512084352');
-QUERY: INSERT INTO num_exp_add VALUES (3,3,'8.62');
-QUERY: INSERT INTO num_exp_sub VALUES (3,3,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (3,3,'18.5761');
-QUERY: INSERT INTO num_exp_div VALUES (3,3,'1.00000000000000000000');
-QUERY: INSERT INTO num_exp_add VALUES (3,4,'7799465.7219');
-QUERY: INSERT INTO num_exp_sub VALUES (3,4,'-7799457.1019');
-QUERY: INSERT INTO num_exp_mul VALUES (3,4,'33615678.685289');
-QUERY: INSERT INTO num_exp_div VALUES (3,4,'.00000055260225961552');
-QUERY: INSERT INTO num_exp_add VALUES (3,5,'16401.348491');
-QUERY: INSERT INTO num_exp_sub VALUES (3,5,'-16392.728491');
-QUERY: INSERT INTO num_exp_mul VALUES (3,5,'70671.23589621');
-QUERY: INSERT INTO num_exp_div VALUES (3,5,'.00026285234387695504');
-QUERY: INSERT INTO num_exp_add VALUES (3,6,'93905.88763026');
-QUERY: INSERT INTO num_exp_sub VALUES (3,6,'-93897.26763026');
-QUERY: INSERT INTO num_exp_mul VALUES (3,6,'404715.7995864206');
-QUERY: INSERT INTO num_exp_div VALUES (3,6,'.00004589912234457595');
-QUERY: INSERT INTO num_exp_add VALUES (3,7,'-83028480.69');
-QUERY: INSERT INTO num_exp_sub VALUES (3,7,'83028489.31');
-QUERY: INSERT INTO num_exp_mul VALUES (3,7,'-357852770.35');
-QUERY: INSERT INTO num_exp_div VALUES (3,7,'-.00000005190989574240');
-QUERY: INSERT INTO num_exp_add VALUES (3,8,'74885.31');
-QUERY: INSERT INTO num_exp_sub VALUES (3,8,'-74876.69');
-QUERY: INSERT INTO num_exp_mul VALUES (3,8,'322737.11');
-QUERY: INSERT INTO num_exp_div VALUES (3,8,'.00005755799201399553');
-QUERY: INSERT INTO num_exp_add VALUES (3,9,'-24926799.735047420');
-QUERY: INSERT INTO num_exp_sub VALUES (3,9,'24926808.355047420');
-QUERY: INSERT INTO num_exp_mul VALUES (3,9,'-107434525.43415438020');
-QUERY: INSERT INTO num_exp_div VALUES (3,9,'-.00000017290624149854');
-QUERY: INSERT INTO num_exp_add VALUES (4,0,'7799461.4119');
-QUERY: INSERT INTO num_exp_sub VALUES (4,0,'7799461.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (4,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (4,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (4,1,'7799461.4119');
-QUERY: INSERT INTO num_exp_sub VALUES (4,1,'7799461.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (4,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (4,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (4,2,'-26539030.803497047');
-QUERY: INSERT INTO num_exp_sub VALUES (4,2,'42137953.627297047');
-QUERY: INSERT INTO num_exp_mul VALUES (4,2,'-267821744976817.8111137106593');
-QUERY: INSERT INTO num_exp_div VALUES (4,2,'-.22713465002993920385');
-QUERY: INSERT INTO num_exp_add VALUES (4,3,'7799465.7219');
-QUERY: INSERT INTO num_exp_sub VALUES (4,3,'7799457.1019');
-QUERY: INSERT INTO num_exp_mul VALUES (4,3,'33615678.685289');
-QUERY: INSERT INTO num_exp_div VALUES (4,3,'1809619.81714617169373549883');
-QUERY: INSERT INTO num_exp_add VALUES (4,4,'15598922.8238');
-QUERY: INSERT INTO num_exp_sub VALUES (4,4,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (4,4,'60831598315717.14146161');
-QUERY: INSERT INTO num_exp_div VALUES (4,4,'1.00000000000000000000');
-QUERY: INSERT INTO num_exp_add VALUES (4,5,'7815858.450391');
-QUERY: INSERT INTO num_exp_sub VALUES (4,5,'7783064.373409');
-QUERY: INSERT INTO num_exp_mul VALUES (4,5,'127888068979.9935054429');
-QUERY: INSERT INTO num_exp_div VALUES (4,5,'475.66281046305802686061');
-QUERY: INSERT INTO num_exp_add VALUES (4,6,'7893362.98953026');
-QUERY: INSERT INTO num_exp_sub VALUES (4,6,'7705559.83426974');
-QUERY: INSERT INTO num_exp_mul VALUES (4,6,'732381731243.745115764094');
-QUERY: INSERT INTO num_exp_div VALUES (4,6,'83.05996138436129499606');
-QUERY: INSERT INTO num_exp_add VALUES (4,7,'-75229023.5881');
-QUERY: INSERT INTO num_exp_sub VALUES (4,7,'90827946.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (4,7,'-647577464846017.9715');
-QUERY: INSERT INTO num_exp_div VALUES (4,7,'-.09393717604145131637');
-QUERY: INSERT INTO num_exp_add VALUES (4,8,'7874342.4119');
-QUERY: INSERT INTO num_exp_sub VALUES (4,8,'7724580.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (4,8,'584031469984.4839');
-QUERY: INSERT INTO num_exp_div VALUES (4,8,'104.15808298366741897143');
-QUERY: INSERT INTO num_exp_add VALUES (4,9,'-17127342.633147420');
-QUERY: INSERT INTO num_exp_sub VALUES (4,9,'32726265.456947420');
-QUERY: INSERT INTO num_exp_mul VALUES (4,9,'-194415646271340.1815956522980');
-QUERY: INSERT INTO num_exp_div VALUES (4,9,'-.31289456112403769409');
-QUERY: INSERT INTO num_exp_add VALUES (5,0,'16397.038491');
-QUERY: INSERT INTO num_exp_sub VALUES (5,0,'16397.038491');
-QUERY: INSERT INTO num_exp_mul VALUES (5,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (5,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (5,1,'16397.038491');
-QUERY: INSERT INTO num_exp_sub VALUES (5,1,'16397.038491');
-QUERY: INSERT INTO num_exp_mul VALUES (5,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (5,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (5,2,'-34322095.176906047');
-QUERY: INSERT INTO num_exp_sub VALUES (5,2,'34354889.253888047');
-QUERY: INSERT INTO num_exp_mul VALUES (5,2,'-563049578578.769242506736077');
-QUERY: INSERT INTO num_exp_div VALUES (5,2,'-.00047751189505192446');
-QUERY: INSERT INTO num_exp_add VALUES (5,3,'16401.348491');
-QUERY: INSERT INTO num_exp_sub VALUES (5,3,'16392.728491');
-QUERY: INSERT INTO num_exp_mul VALUES (5,3,'70671.23589621');
-QUERY: INSERT INTO num_exp_div VALUES (5,3,'3804.41728329466357308584');
-QUERY: INSERT INTO num_exp_add VALUES (5,4,'7815858.450391');
-QUERY: INSERT INTO num_exp_sub VALUES (5,4,'-7783064.373409');
-QUERY: INSERT INTO num_exp_mul VALUES (5,4,'127888068979.9935054429');
-QUERY: INSERT INTO num_exp_div VALUES (5,4,'.00210232958726897192');
-QUERY: INSERT INTO num_exp_add VALUES (5,5,'32794.076982');
-QUERY: INSERT INTO num_exp_sub VALUES (5,5,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (5,5,'268862871.275335557081');
-QUERY: INSERT INTO num_exp_div VALUES (5,5,'1.00000000000000000000');
-QUERY: INSERT INTO num_exp_add VALUES (5,6,'110298.61612126');
-QUERY: INSERT INTO num_exp_sub VALUES (5,6,'-77504.53913926');
-QUERY: INSERT INTO num_exp_mul VALUES (5,6,'1539707782.76899778633766');
-QUERY: INSERT INTO num_exp_div VALUES (5,6,'.17461941433576102689');
-QUERY: INSERT INTO num_exp_add VALUES (5,7,'-83012087.961509');
-QUERY: INSERT INTO num_exp_sub VALUES (5,7,'83044882.038491');
-QUERY: INSERT INTO num_exp_mul VALUES (5,7,'-1361421264394.416135');
-QUERY: INSERT INTO num_exp_div VALUES (5,7,'-.00019748690453643710');
-QUERY: INSERT INTO num_exp_add VALUES (5,8,'91278.038491');
-QUERY: INSERT INTO num_exp_sub VALUES (5,8,'-58483.961509');
-QUERY: INSERT INTO num_exp_mul VALUES (5,8,'1227826639.244571');
-QUERY: INSERT INTO num_exp_div VALUES (5,8,'.21897461960978085228');
-QUERY: INSERT INTO num_exp_add VALUES (5,9,'-24910407.006556420');
-QUERY: INSERT INTO num_exp_sub VALUES (5,9,'24943201.083538420');
-QUERY: INSERT INTO num_exp_mul VALUES (5,9,'-408725765384.257043660243220');
-QUERY: INSERT INTO num_exp_div VALUES (5,9,'-.00065780749354660427');
-QUERY: INSERT INTO num_exp_add VALUES (6,0,'93901.57763026');
-QUERY: INSERT INTO num_exp_sub VALUES (6,0,'93901.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (6,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (6,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (6,1,'93901.57763026');
-QUERY: INSERT INTO num_exp_sub VALUES (6,1,'93901.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (6,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (6,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (6,2,'-34244590.637766787');
-QUERY: INSERT INTO num_exp_sub VALUES (6,2,'34432393.793027307');
-QUERY: INSERT INTO num_exp_mul VALUES (6,2,'-3224438592470.18449811926184222');
-QUERY: INSERT INTO num_exp_div VALUES (6,2,'-.00273458651128995823');
-QUERY: INSERT INTO num_exp_add VALUES (6,3,'93905.88763026');
-QUERY: INSERT INTO num_exp_sub VALUES (6,3,'93897.26763026');
-QUERY: INSERT INTO num_exp_mul VALUES (6,3,'404715.7995864206');
-QUERY: INSERT INTO num_exp_div VALUES (6,3,'21786.90896293735498839907');
-QUERY: INSERT INTO num_exp_add VALUES (6,4,'7893362.98953026');
-QUERY: INSERT INTO num_exp_sub VALUES (6,4,'-7705559.83426974');
-QUERY: INSERT INTO num_exp_mul VALUES (6,4,'732381731243.745115764094');
-QUERY: INSERT INTO num_exp_div VALUES (6,4,'.01203949512295682469');
-QUERY: INSERT INTO num_exp_add VALUES (6,5,'110298.61612126');
-QUERY: INSERT INTO num_exp_sub VALUES (6,5,'77504.53913926');
-QUERY: INSERT INTO num_exp_mul VALUES (6,5,'1539707782.76899778633766');
-QUERY: INSERT INTO num_exp_div VALUES (6,5,'5.72674008674192359679');
-QUERY: INSERT INTO num_exp_add VALUES (6,6,'187803.15526052');
-QUERY: INSERT INTO num_exp_sub VALUES (6,6,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (6,6,'8817506281.4517452372676676');
-QUERY: INSERT INTO num_exp_div VALUES (6,6,'1.00000000000000000000');
-QUERY: INSERT INTO num_exp_add VALUES (6,7,'-82934583.42236974');
-QUERY: INSERT INTO num_exp_sub VALUES (6,7,'83122386.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (6,7,'-7796505729750.37795610');
-QUERY: INSERT INTO num_exp_div VALUES (6,7,'-.00113095617281538980');
-QUERY: INSERT INTO num_exp_add VALUES (6,8,'168782.57763026');
-QUERY: INSERT INTO num_exp_sub VALUES (6,8,'19020.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (6,8,'7031444034.53149906');
-QUERY: INSERT INTO num_exp_div VALUES (6,8,'1.25401073209839612184');
-QUERY: INSERT INTO num_exp_add VALUES (6,9,'-24832902.467417160');
-QUERY: INSERT INTO num_exp_sub VALUES (6,9,'25020705.622677680');
-QUERY: INSERT INTO num_exp_mul VALUES (6,9,'-2340666225110.29929521292692920');
-QUERY: INSERT INTO num_exp_div VALUES (6,9,'-.00376709254265256789');
-QUERY: INSERT INTO num_exp_add VALUES (7,0,'-83028485');
-QUERY: INSERT INTO num_exp_sub VALUES (7,0,'-83028485');
-QUERY: INSERT INTO num_exp_mul VALUES (7,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (7,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (7,1,'-83028485');
-QUERY: INSERT INTO num_exp_sub VALUES (7,1,'-83028485');
-QUERY: INSERT INTO num_exp_mul VALUES (7,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (7,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (7,2,'-117366977.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (7,2,'-48689992.784602953');
-QUERY: INSERT INTO num_exp_mul VALUES (7,2,'2851072985828710.485883795');
-QUERY: INSERT INTO num_exp_div VALUES (7,2,'2.41794207151503385700');
-QUERY: INSERT INTO num_exp_add VALUES (7,3,'-83028480.69');
-QUERY: INSERT INTO num_exp_sub VALUES (7,3,'-83028489.31');
-QUERY: INSERT INTO num_exp_mul VALUES (7,3,'-357852770.35');
-QUERY: INSERT INTO num_exp_div VALUES (7,3,'-19264149.65197215777262180974');
-QUERY: INSERT INTO num_exp_add VALUES (7,4,'-75229023.5881');
-QUERY: INSERT INTO num_exp_sub VALUES (7,4,'-90827946.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (7,4,'-647577464846017.9715');
-QUERY: INSERT INTO num_exp_div VALUES (7,4,'-10.64541262725136247686');
-QUERY: INSERT INTO num_exp_add VALUES (7,5,'-83012087.961509');
-QUERY: INSERT INTO num_exp_sub VALUES (7,5,'-83044882.038491');
-QUERY: INSERT INTO num_exp_mul VALUES (7,5,'-1361421264394.416135');
-QUERY: INSERT INTO num_exp_div VALUES (7,5,'-5063.62688881730941836574');
-QUERY: INSERT INTO num_exp_add VALUES (7,6,'-82934583.42236974');
-QUERY: INSERT INTO num_exp_sub VALUES (7,6,'-83122386.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (7,6,'-7796505729750.37795610');
-QUERY: INSERT INTO num_exp_div VALUES (7,6,'-884.20756174009028770294');
-QUERY: INSERT INTO num_exp_add VALUES (7,7,'-166056970');
-QUERY: INSERT INTO num_exp_sub VALUES (7,7,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (7,7,'6893729321395225');
-QUERY: INSERT INTO num_exp_div VALUES (7,7,'1.00000000000000000000');
-QUERY: INSERT INTO num_exp_add VALUES (7,8,'-82953604');
-QUERY: INSERT INTO num_exp_sub VALUES (7,8,'-83103366');
-QUERY: INSERT INTO num_exp_mul VALUES (7,8,'-6217255985285');
-QUERY: INSERT INTO num_exp_div VALUES (7,8,'-1108.80577182462841041118');
-QUERY: INSERT INTO num_exp_add VALUES (7,9,'-107955289.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (7,9,'-58101680.954952580');
-QUERY: INSERT INTO num_exp_mul VALUES (7,9,'2069634775752159.035758700');
-QUERY: INSERT INTO num_exp_div VALUES (7,9,'3.33089171198810413382');
-QUERY: INSERT INTO num_exp_add VALUES (8,0,'74881');
-QUERY: INSERT INTO num_exp_sub VALUES (8,0,'74881');
-QUERY: INSERT INTO num_exp_mul VALUES (8,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (8,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (8,1,'74881');
-QUERY: INSERT INTO num_exp_sub VALUES (8,1,'74881');
-QUERY: INSERT INTO num_exp_mul VALUES (8,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (8,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (8,2,'-34263611.215397047');
-QUERY: INSERT INTO num_exp_sub VALUES (8,2,'34413373.215397047');
-QUERY: INSERT INTO num_exp_mul VALUES (8,2,'-2571300635581.146276407');
-QUERY: INSERT INTO num_exp_div VALUES (8,2,'-.00218067233500788615');
-QUERY: INSERT INTO num_exp_add VALUES (8,3,'74885.31');
-QUERY: INSERT INTO num_exp_sub VALUES (8,3,'74876.69');
-QUERY: INSERT INTO num_exp_mul VALUES (8,3,'322737.11');
-QUERY: INSERT INTO num_exp_div VALUES (8,3,'17373.78190255220417633410');
-QUERY: INSERT INTO num_exp_add VALUES (8,4,'7874342.4119');
-QUERY: INSERT INTO num_exp_sub VALUES (8,4,'-7724580.4119');
-QUERY: INSERT INTO num_exp_mul VALUES (8,4,'584031469984.4839');
-QUERY: INSERT INTO num_exp_div VALUES (8,4,'.00960079113741758956');
-QUERY: INSERT INTO num_exp_add VALUES (8,5,'91278.038491');
-QUERY: INSERT INTO num_exp_sub VALUES (8,5,'58483.961509');
-QUERY: INSERT INTO num_exp_mul VALUES (8,5,'1227826639.244571');
-QUERY: INSERT INTO num_exp_div VALUES (8,5,'4.56673929509287019456');
-QUERY: INSERT INTO num_exp_add VALUES (8,6,'168782.57763026');
-QUERY: INSERT INTO num_exp_sub VALUES (8,6,'-19020.57763026');
-QUERY: INSERT INTO num_exp_mul VALUES (8,6,'7031444034.53149906');
-QUERY: INSERT INTO num_exp_div VALUES (8,6,'.79744134113322314424');
-QUERY: INSERT INTO num_exp_add VALUES (8,7,'-82953604');
-QUERY: INSERT INTO num_exp_sub VALUES (8,7,'83103366');
-QUERY: INSERT INTO num_exp_mul VALUES (8,7,'-6217255985285');
-QUERY: INSERT INTO num_exp_div VALUES (8,7,'-.00090187120721280172');
-QUERY: INSERT INTO num_exp_add VALUES (8,8,'149762');
-QUERY: INSERT INTO num_exp_sub VALUES (8,8,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (8,8,'5607164161');
-QUERY: INSERT INTO num_exp_div VALUES (8,8,'1.00000000000000000000');
-QUERY: INSERT INTO num_exp_add VALUES (8,9,'-24851923.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (8,9,'25001685.045047420');
-QUERY: INSERT INTO num_exp_mul VALUES (8,9,'-1866544013697.195857020');
-QUERY: INSERT INTO num_exp_div VALUES (8,9,'-.00300403532938582735');
-QUERY: INSERT INTO num_exp_add VALUES (9,0,'-24926804.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (9,0,'-24926804.045047420');
-QUERY: INSERT INTO num_exp_mul VALUES (9,0,'0');
-QUERY: INSERT INTO num_exp_div VALUES (9,0,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (9,1,'-24926804.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (9,1,'-24926804.045047420');
-QUERY: INSERT INTO num_exp_mul VALUES (9,1,'0');
-QUERY: INSERT INTO num_exp_div VALUES (9,1,'NaN');
-QUERY: INSERT INTO num_exp_add VALUES (9,2,'-59265296.260444467');
-QUERY: INSERT INTO num_exp_sub VALUES (9,2,'9411688.170349627');
-QUERY: INSERT INTO num_exp_mul VALUES (9,2,'855948866655588.453741509242968740');
-QUERY: INSERT INTO num_exp_div VALUES (9,2,'.72591434384152961526');
-QUERY: INSERT INTO num_exp_add VALUES (9,3,'-24926799.735047420');
-QUERY: INSERT INTO num_exp_sub VALUES (9,3,'-24926808.355047420');
-QUERY: INSERT INTO num_exp_mul VALUES (9,3,'-107434525.43415438020');
-QUERY: INSERT INTO num_exp_div VALUES (9,3,'-5783481.21694835730858468677');
-QUERY: INSERT INTO num_exp_add VALUES (9,4,'-17127342.633147420');
-QUERY: INSERT INTO num_exp_sub VALUES (9,4,'-32726265.456947420');
-QUERY: INSERT INTO num_exp_mul VALUES (9,4,'-194415646271340.1815956522980');
-QUERY: INSERT INTO num_exp_div VALUES (9,4,'-3.19596478892958416484');
-QUERY: INSERT INTO num_exp_add VALUES (9,5,'-24910407.006556420');
-QUERY: INSERT INTO num_exp_sub VALUES (9,5,'-24943201.083538420');
-QUERY: INSERT INTO num_exp_mul VALUES (9,5,'-408725765384.257043660243220');
-QUERY: INSERT INTO num_exp_div VALUES (9,5,'-1520.20159364322004505807');
-QUERY: INSERT INTO num_exp_add VALUES (9,6,'-24832902.467417160');
-QUERY: INSERT INTO num_exp_sub VALUES (9,6,'-25020705.622677680');
-QUERY: INSERT INTO num_exp_mul VALUES (9,6,'-2340666225110.29929521292692920');
-QUERY: INSERT INTO num_exp_div VALUES (9,6,'-265.45671195426965751280');
-QUERY: INSERT INTO num_exp_add VALUES (9,7,'-107955289.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (9,7,'58101680.954952580');
-QUERY: INSERT INTO num_exp_mul VALUES (9,7,'2069634775752159.035758700');
-QUERY: INSERT INTO num_exp_div VALUES (9,7,'.30021990699995814689');
-QUERY: INSERT INTO num_exp_add VALUES (9,8,'-24851923.045047420');
-QUERY: INSERT INTO num_exp_sub VALUES (9,8,'-25001685.045047420');
-QUERY: INSERT INTO num_exp_mul VALUES (9,8,'-1866544013697.195857020');
-QUERY: INSERT INTO num_exp_div VALUES (9,8,'-332.88556569820675471748');
-QUERY: INSERT INTO num_exp_add VALUES (9,9,'-49853608.090094840');
-QUERY: INSERT INTO num_exp_sub VALUES (9,9,'0');
-QUERY: INSERT INTO num_exp_mul VALUES (9,9,'621345559900192.420120630048656400');
-QUERY: INSERT INTO num_exp_div VALUES (9,9,'1.00000000000000000000');
-QUERY: COMMIT TRANSACTION;
-QUERY: BEGIN TRANSACTION;
-QUERY: INSERT INTO num_exp_sqrt VALUES (0,'0');
-QUERY: INSERT INTO num_exp_sqrt VALUES (1,'0');
-QUERY: INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505');
-QUERY: INSERT INTO num_exp_sqrt VALUES (3,'2.07605394920266944396');
-QUERY: INSERT INTO num_exp_sqrt VALUES (4,'2792.75158435189147418923');
-QUERY: INSERT INTO num_exp_sqrt VALUES (5,'128.05092147657509145473');
-QUERY: INSERT INTO num_exp_sqrt VALUES (6,'306.43364311096782703406');
-QUERY: INSERT INTO num_exp_sqrt VALUES (7,'9111.99676251039939975230');
-QUERY: INSERT INTO num_exp_sqrt VALUES (8,'273.64392922189960397542');
-QUERY: INSERT INTO num_exp_sqrt VALUES (9,'4992.67503899937593364766');
-QUERY: COMMIT TRANSACTION;
-QUERY: BEGIN TRANSACTION;
-QUERY: INSERT INTO num_exp_ln VALUES (0,'NaN');
-QUERY: INSERT INTO num_exp_ln VALUES (1,'NaN');
-QUERY: INSERT INTO num_exp_ln VALUES (2,'17.35177750493897715514');
-QUERY: INSERT INTO num_exp_ln VALUES (3,'1.46093790411565641971');
-QUERY: INSERT INTO num_exp_ln VALUES (4,'15.86956523951936572464');
-QUERY: INSERT INTO num_exp_ln VALUES (5,'9.70485601768871834038');
-QUERY: INSERT INTO num_exp_ln VALUES (6,'11.45000246622944403127');
-QUERY: INSERT INTO num_exp_ln VALUES (7,'18.23469429965478772991');
-QUERY: INSERT INTO num_exp_ln VALUES (8,'11.22365546576315513668');
-QUERY: INSERT INTO num_exp_ln VALUES (9,'17.03145425013166006962');
-QUERY: COMMIT TRANSACTION;
-QUERY: BEGIN TRANSACTION;
-QUERY: INSERT INTO num_exp_log10 VALUES (0,'NaN');
-QUERY: INSERT INTO num_exp_log10 VALUES (1,'NaN');
-QUERY: INSERT INTO num_exp_log10 VALUES (2,'7.53578122160797276459');
-QUERY: INSERT INTO num_exp_log10 VALUES (3,'.63447727016073160075');
-QUERY: INSERT INTO num_exp_log10 VALUES (4,'6.89206461372691743345');
-QUERY: INSERT INTO num_exp_log10 VALUES (5,'4.21476541614777768626');
-QUERY: INSERT INTO num_exp_log10 VALUES (6,'4.97267288886207207671');
-QUERY: INSERT INTO num_exp_log10 VALUES (7,'7.91922711353275546914');
-QUERY: INSERT INTO num_exp_log10 VALUES (8,'4.87437163556421004138');
-QUERY: INSERT INTO num_exp_log10 VALUES (9,'7.39666659961986567059');
-QUERY: COMMIT TRANSACTION;
-QUERY: BEGIN TRANSACTION;
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (2,'224790267919917955.13261618583642653184');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (3,'28.90266599445155957393');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (4,'7405685069594999.07733999469386277636');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (5,'5068226527.32127265408584640098');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (6,'281839893606.99372343357047819067');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (7,'1716699575118597095.42330819910640247627');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (8,'167361463828.07491320069016125952');
-QUERY: INSERT INTO num_exp_power_10_ln VALUES (9,'107511333880052007.04141124673540337457');
-QUERY: COMMIT TRANSACTION;
-QUERY: BEGIN TRANSACTION;
-QUERY: INSERT INTO num_data VALUES (0, '0');
-QUERY: INSERT INTO num_data VALUES (1, '0');
-QUERY: INSERT INTO num_data VALUES (2, '-34338492.215397047');
-QUERY: INSERT INTO num_data VALUES (3, '4.31');
-QUERY: INSERT INTO num_data VALUES (4, '7799461.4119');
-QUERY: INSERT INTO num_data VALUES (5, '16397.038491');
-QUERY: INSERT INTO num_data VALUES (6, '93901.57763026');
-QUERY: INSERT INTO num_data VALUES (7, '-83028485');
-QUERY: INSERT INTO num_data VALUES (8, '74881');
-QUERY: INSERT INTO num_data VALUES (9, '-24926804.045047420');
-QUERY: COMMIT TRANSACTION;
-QUERY: CREATE UNIQUE INDEX num_exp_add_idx ON num_exp_add (id1, id2);
-QUERY: CREATE UNIQUE INDEX num_exp_sub_idx ON num_exp_sub (id1, id2);
-QUERY: CREATE UNIQUE INDEX num_exp_div_idx ON num_exp_div (id1, id2);
-QUERY: CREATE UNIQUE INDEX num_exp_mul_idx ON num_exp_mul (id1, id2);
-QUERY: CREATE UNIQUE INDEX num_exp_sqrt_idx ON num_exp_sqrt (id);
-QUERY: CREATE UNIQUE INDEX num_exp_ln_idx ON num_exp_ln (id);
-QUERY: CREATE UNIQUE INDEX num_exp_log10_idx ON num_exp_log10 (id);
-QUERY: CREATE UNIQUE INDEX num_exp_power_10_ln_idx ON num_exp_power_10_ln (id);
-QUERY: VACUUM ANALYZE num_exp_add;
-QUERY: VACUUM ANALYZE num_exp_sub;
-QUERY: VACUUM ANALYZE num_exp_div;
-QUERY: VACUUM ANALYZE num_exp_mul;
-QUERY: VACUUM ANALYZE num_exp_sqrt;
-QUERY: VACUUM ANALYZE num_exp_ln;
-QUERY: VACUUM ANALYZE num_exp_log10;
-QUERY: VACUUM ANALYZE num_exp_power_10_ln;
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, t1.val + t2.val
+--
+-- NUMERIC
+--
+CREATE TABLE num_data (id int4, val numeric(210,10));
+CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sqrt (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_log10 (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_power_10_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_result (id1 int4, id2 int4, result numeric(210,10));
+-- ******************************
+-- * The following EXPECTED results are computed by bc(1)
+-- * with a scale of 200
+-- ******************************
+BEGIN TRANSACTION;
+INSERT INTO num_exp_add VALUES (0,0,'0');
+INSERT INTO num_exp_sub VALUES (0,0,'0');
+INSERT INTO num_exp_mul VALUES (0,0,'0');
+INSERT INTO num_exp_div VALUES (0,0,'NaN');
+INSERT INTO num_exp_add VALUES (0,1,'0');
+INSERT INTO num_exp_sub VALUES (0,1,'0');
+INSERT INTO num_exp_mul VALUES (0,1,'0');
+INSERT INTO num_exp_div VALUES (0,1,'NaN');
+INSERT INTO num_exp_add VALUES (0,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (0,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (0,2,'0');
+INSERT INTO num_exp_div VALUES (0,2,'0');
+INSERT INTO num_exp_add VALUES (0,3,'4.31');
+INSERT INTO num_exp_sub VALUES (0,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (0,3,'0');
+INSERT INTO num_exp_div VALUES (0,3,'0');
+INSERT INTO num_exp_add VALUES (0,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (0,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (0,4,'0');
+INSERT INTO num_exp_div VALUES (0,4,'0');
+INSERT INTO num_exp_add VALUES (0,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (0,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (0,5,'0');
+INSERT INTO num_exp_div VALUES (0,5,'0');
+INSERT INTO num_exp_add VALUES (0,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (0,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (0,6,'0');
+INSERT INTO num_exp_div VALUES (0,6,'0');
+INSERT INTO num_exp_add VALUES (0,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (0,7,'83028485');
+INSERT INTO num_exp_mul VALUES (0,7,'0');
+INSERT INTO num_exp_div VALUES (0,7,'0');
+INSERT INTO num_exp_add VALUES (0,8,'74881');
+INSERT INTO num_exp_sub VALUES (0,8,'-74881');
+INSERT INTO num_exp_mul VALUES (0,8,'0');
+INSERT INTO num_exp_div VALUES (0,8,'0');
+INSERT INTO num_exp_add VALUES (0,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (0,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (0,9,'0');
+INSERT INTO num_exp_div VALUES (0,9,'0');
+INSERT INTO num_exp_add VALUES (1,0,'0');
+INSERT INTO num_exp_sub VALUES (1,0,'0');
+INSERT INTO num_exp_mul VALUES (1,0,'0');
+INSERT INTO num_exp_div VALUES (1,0,'NaN');
+INSERT INTO num_exp_add VALUES (1,1,'0');
+INSERT INTO num_exp_sub VALUES (1,1,'0');
+INSERT INTO num_exp_mul VALUES (1,1,'0');
+INSERT INTO num_exp_div VALUES (1,1,'NaN');
+INSERT INTO num_exp_add VALUES (1,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (1,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (1,2,'0');
+INSERT INTO num_exp_div VALUES (1,2,'0');
+INSERT INTO num_exp_add VALUES (1,3,'4.31');
+INSERT INTO num_exp_sub VALUES (1,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (1,3,'0');
+INSERT INTO num_exp_div VALUES (1,3,'0');
+INSERT INTO num_exp_add VALUES (1,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (1,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (1,4,'0');
+INSERT INTO num_exp_div VALUES (1,4,'0');
+INSERT INTO num_exp_add VALUES (1,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (1,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (1,5,'0');
+INSERT INTO num_exp_div VALUES (1,5,'0');
+INSERT INTO num_exp_add VALUES (1,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (1,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (1,6,'0');
+INSERT INTO num_exp_div VALUES (1,6,'0');
+INSERT INTO num_exp_add VALUES (1,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (1,7,'83028485');
+INSERT INTO num_exp_mul VALUES (1,7,'0');
+INSERT INTO num_exp_div VALUES (1,7,'0');
+INSERT INTO num_exp_add VALUES (1,8,'74881');
+INSERT INTO num_exp_sub VALUES (1,8,'-74881');
+INSERT INTO num_exp_mul VALUES (1,8,'0');
+INSERT INTO num_exp_div VALUES (1,8,'0');
+INSERT INTO num_exp_add VALUES (1,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (1,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (1,9,'0');
+INSERT INTO num_exp_div VALUES (1,9,'0');
+INSERT INTO num_exp_add VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,0,'0');
+INSERT INTO num_exp_div VALUES (2,0,'NaN');
+INSERT INTO num_exp_add VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,1,'0');
+INSERT INTO num_exp_div VALUES (2,1,'NaN');
+INSERT INTO num_exp_add VALUES (2,2,'-68676984.430794094');
+INSERT INTO num_exp_sub VALUES (2,2,'0');
+INSERT INTO num_exp_mul VALUES (2,2,'1179132047626883.596862135856320209');
+INSERT INTO num_exp_div VALUES (2,2,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (2,3,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (2,3,'-34338496.525397047');
+INSERT INTO num_exp_mul VALUES (2,3,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (2,3,'-7967167.56737750510440835266');
+INSERT INTO num_exp_add VALUES (2,4,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (2,4,'-42137953.627297047');
+INSERT INTO num_exp_mul VALUES (2,4,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (2,4,'-4.40267480046830116685');
+INSERT INTO num_exp_add VALUES (2,5,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (2,5,'-34354889.253888047');
+INSERT INTO num_exp_mul VALUES (2,5,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (2,5,'-2094.18866914563535496429');
+INSERT INTO num_exp_add VALUES (2,6,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (2,6,'-34432393.793027307');
+INSERT INTO num_exp_mul VALUES (2,6,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (2,6,'-365.68599891479766440940');
+INSERT INTO num_exp_add VALUES (2,7,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (2,7,'48689992.784602953');
+INSERT INTO num_exp_mul VALUES (2,7,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (2,7,'.41357483778485235518');
+INSERT INTO num_exp_add VALUES (2,8,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047');
+INSERT INTO num_exp_mul VALUES (2,8,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (2,8,'-458.57416721727870888476');
+INSERT INTO num_exp_add VALUES (2,9,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (2,9,'-9411688.170349627');
+INSERT INTO num_exp_mul VALUES (2,9,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (2,9,'1.37757299946438931811');
+INSERT INTO num_exp_add VALUES (3,0,'4.31');
+INSERT INTO num_exp_sub VALUES (3,0,'4.31');
+INSERT INTO num_exp_mul VALUES (3,0,'0');
+INSERT INTO num_exp_div VALUES (3,0,'NaN');
+INSERT INTO num_exp_add VALUES (3,1,'4.31');
+INSERT INTO num_exp_sub VALUES (3,1,'4.31');
+INSERT INTO num_exp_mul VALUES (3,1,'0');
+INSERT INTO num_exp_div VALUES (3,1,'NaN');
+INSERT INTO num_exp_add VALUES (3,2,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (3,2,'34338496.525397047');
+INSERT INTO num_exp_mul VALUES (3,2,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (3,2,'-.00000012551512084352');
+INSERT INTO num_exp_add VALUES (3,3,'8.62');
+INSERT INTO num_exp_sub VALUES (3,3,'0');
+INSERT INTO num_exp_mul VALUES (3,3,'18.5761');
+INSERT INTO num_exp_div VALUES (3,3,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (3,4,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (3,4,'-7799457.1019');
+INSERT INTO num_exp_mul VALUES (3,4,'33615678.685289');
+INSERT INTO num_exp_div VALUES (3,4,'.00000055260225961552');
+INSERT INTO num_exp_add VALUES (3,5,'16401.348491');
+INSERT INTO num_exp_sub VALUES (3,5,'-16392.728491');
+INSERT INTO num_exp_mul VALUES (3,5,'70671.23589621');
+INSERT INTO num_exp_div VALUES (3,5,'.00026285234387695504');
+INSERT INTO num_exp_add VALUES (3,6,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (3,6,'-93897.26763026');
+INSERT INTO num_exp_mul VALUES (3,6,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (3,6,'.00004589912234457595');
+INSERT INTO num_exp_add VALUES (3,7,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (3,7,'83028489.31');
+INSERT INTO num_exp_mul VALUES (3,7,'-357852770.35');
+INSERT INTO num_exp_div VALUES (3,7,'-.00000005190989574240');
+INSERT INTO num_exp_add VALUES (3,8,'74885.31');
+INSERT INTO num_exp_sub VALUES (3,8,'-74876.69');
+INSERT INTO num_exp_mul VALUES (3,8,'322737.11');
+INSERT INTO num_exp_div VALUES (3,8,'.00005755799201399553');
+INSERT INTO num_exp_add VALUES (3,9,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (3,9,'24926808.355047420');
+INSERT INTO num_exp_mul VALUES (3,9,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (3,9,'-.00000017290624149854');
+INSERT INTO num_exp_add VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,0,'0');
+INSERT INTO num_exp_div VALUES (4,0,'NaN');
+INSERT INTO num_exp_add VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,1,'0');
+INSERT INTO num_exp_div VALUES (4,1,'NaN');
+INSERT INTO num_exp_add VALUES (4,2,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (4,2,'42137953.627297047');
+INSERT INTO num_exp_mul VALUES (4,2,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (4,2,'-.22713465002993920385');
+INSERT INTO num_exp_add VALUES (4,3,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (4,3,'7799457.1019');
+INSERT INTO num_exp_mul VALUES (4,3,'33615678.685289');
+INSERT INTO num_exp_div VALUES (4,3,'1809619.81714617169373549883');
+INSERT INTO num_exp_add VALUES (4,4,'15598922.8238');
+INSERT INTO num_exp_sub VALUES (4,4,'0');
+INSERT INTO num_exp_mul VALUES (4,4,'60831598315717.14146161');
+INSERT INTO num_exp_div VALUES (4,4,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (4,5,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (4,5,'7783064.373409');
+INSERT INTO num_exp_mul VALUES (4,5,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (4,5,'475.66281046305802686061');
+INSERT INTO num_exp_add VALUES (4,6,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (4,6,'7705559.83426974');
+INSERT INTO num_exp_mul VALUES (4,6,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (4,6,'83.05996138436129499606');
+INSERT INTO num_exp_add VALUES (4,7,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (4,7,'90827946.4119');
+INSERT INTO num_exp_mul VALUES (4,7,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (4,7,'-.09393717604145131637');
+INSERT INTO num_exp_add VALUES (4,8,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (4,8,'7724580.4119');
+INSERT INTO num_exp_mul VALUES (4,8,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (4,8,'104.15808298366741897143');
+INSERT INTO num_exp_add VALUES (4,9,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (4,9,'32726265.456947420');
+INSERT INTO num_exp_mul VALUES (4,9,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (4,9,'-.31289456112403769409');
+INSERT INTO num_exp_add VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,0,'0');
+INSERT INTO num_exp_div VALUES (5,0,'NaN');
+INSERT INTO num_exp_add VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,1,'0');
+INSERT INTO num_exp_div VALUES (5,1,'NaN');
+INSERT INTO num_exp_add VALUES (5,2,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (5,2,'34354889.253888047');
+INSERT INTO num_exp_mul VALUES (5,2,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (5,2,'-.00047751189505192446');
+INSERT INTO num_exp_add VALUES (5,3,'16401.348491');
+INSERT INTO num_exp_sub VALUES (5,3,'16392.728491');
+INSERT INTO num_exp_mul VALUES (5,3,'70671.23589621');
+INSERT INTO num_exp_div VALUES (5,3,'3804.41728329466357308584');
+INSERT INTO num_exp_add VALUES (5,4,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (5,4,'-7783064.373409');
+INSERT INTO num_exp_mul VALUES (5,4,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (5,4,'.00210232958726897192');
+INSERT INTO num_exp_add VALUES (5,5,'32794.076982');
+INSERT INTO num_exp_sub VALUES (5,5,'0');
+INSERT INTO num_exp_mul VALUES (5,5,'268862871.275335557081');
+INSERT INTO num_exp_div VALUES (5,5,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (5,6,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (5,6,'-77504.53913926');
+INSERT INTO num_exp_mul VALUES (5,6,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (5,6,'.17461941433576102689');
+INSERT INTO num_exp_add VALUES (5,7,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (5,7,'83044882.038491');
+INSERT INTO num_exp_mul VALUES (5,7,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (5,7,'-.00019748690453643710');
+INSERT INTO num_exp_add VALUES (5,8,'91278.038491');
+INSERT INTO num_exp_sub VALUES (5,8,'-58483.961509');
+INSERT INTO num_exp_mul VALUES (5,8,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (5,8,'.21897461960978085228');
+INSERT INTO num_exp_add VALUES (5,9,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (5,9,'24943201.083538420');
+INSERT INTO num_exp_mul VALUES (5,9,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (5,9,'-.00065780749354660427');
+INSERT INTO num_exp_add VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,0,'0');
+INSERT INTO num_exp_div VALUES (6,0,'NaN');
+INSERT INTO num_exp_add VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,1,'0');
+INSERT INTO num_exp_div VALUES (6,1,'NaN');
+INSERT INTO num_exp_add VALUES (6,2,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (6,2,'34432393.793027307');
+INSERT INTO num_exp_mul VALUES (6,2,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (6,2,'-.00273458651128995823');
+INSERT INTO num_exp_add VALUES (6,3,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (6,3,'93897.26763026');
+INSERT INTO num_exp_mul VALUES (6,3,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (6,3,'21786.90896293735498839907');
+INSERT INTO num_exp_add VALUES (6,4,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (6,4,'-7705559.83426974');
+INSERT INTO num_exp_mul VALUES (6,4,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (6,4,'.01203949512295682469');
+INSERT INTO num_exp_add VALUES (6,5,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (6,5,'77504.53913926');
+INSERT INTO num_exp_mul VALUES (6,5,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (6,5,'5.72674008674192359679');
+INSERT INTO num_exp_add VALUES (6,6,'187803.15526052');
+INSERT INTO num_exp_sub VALUES (6,6,'0');
+INSERT INTO num_exp_mul VALUES (6,6,'8817506281.4517452372676676');
+INSERT INTO num_exp_div VALUES (6,6,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (6,7,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (6,7,'83122386.57763026');
+INSERT INTO num_exp_mul VALUES (6,7,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (6,7,'-.00113095617281538980');
+INSERT INTO num_exp_add VALUES (6,8,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (6,8,'19020.57763026');
+INSERT INTO num_exp_mul VALUES (6,8,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (6,8,'1.25401073209839612184');
+INSERT INTO num_exp_add VALUES (6,9,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (6,9,'25020705.622677680');
+INSERT INTO num_exp_mul VALUES (6,9,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (6,9,'-.00376709254265256789');
+INSERT INTO num_exp_add VALUES (7,0,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,0,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,0,'0');
+INSERT INTO num_exp_div VALUES (7,0,'NaN');
+INSERT INTO num_exp_add VALUES (7,1,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,1,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,1,'0');
+INSERT INTO num_exp_div VALUES (7,1,'NaN');
+INSERT INTO num_exp_add VALUES (7,2,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (7,2,'-48689992.784602953');
+INSERT INTO num_exp_mul VALUES (7,2,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (7,2,'2.41794207151503385700');
+INSERT INTO num_exp_add VALUES (7,3,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (7,3,'-83028489.31');
+INSERT INTO num_exp_mul VALUES (7,3,'-357852770.35');
+INSERT INTO num_exp_div VALUES (7,3,'-19264149.65197215777262180974');
+INSERT INTO num_exp_add VALUES (7,4,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (7,4,'-90827946.4119');
+INSERT INTO num_exp_mul VALUES (7,4,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (7,4,'-10.64541262725136247686');
+INSERT INTO num_exp_add VALUES (7,5,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (7,5,'-83044882.038491');
+INSERT INTO num_exp_mul VALUES (7,5,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (7,5,'-5063.62688881730941836574');
+INSERT INTO num_exp_add VALUES (7,6,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (7,6,'-83122386.57763026');
+INSERT INTO num_exp_mul VALUES (7,6,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (7,6,'-884.20756174009028770294');
+INSERT INTO num_exp_add VALUES (7,7,'-166056970');
+INSERT INTO num_exp_sub VALUES (7,7,'0');
+INSERT INTO num_exp_mul VALUES (7,7,'6893729321395225');
+INSERT INTO num_exp_div VALUES (7,7,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (7,8,'-82953604');
+INSERT INTO num_exp_sub VALUES (7,8,'-83103366');
+INSERT INTO num_exp_mul VALUES (7,8,'-6217255985285');
+INSERT INTO num_exp_div VALUES (7,8,'-1108.80577182462841041118');
+INSERT INTO num_exp_add VALUES (7,9,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (7,9,'-58101680.954952580');
+INSERT INTO num_exp_mul VALUES (7,9,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (7,9,'3.33089171198810413382');
+INSERT INTO num_exp_add VALUES (8,0,'74881');
+INSERT INTO num_exp_sub VALUES (8,0,'74881');
+INSERT INTO num_exp_mul VALUES (8,0,'0');
+INSERT INTO num_exp_div VALUES (8,0,'NaN');
+INSERT INTO num_exp_add VALUES (8,1,'74881');
+INSERT INTO num_exp_sub VALUES (8,1,'74881');
+INSERT INTO num_exp_mul VALUES (8,1,'0');
+INSERT INTO num_exp_div VALUES (8,1,'NaN');
+INSERT INTO num_exp_add VALUES (8,2,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (8,2,'34413373.215397047');
+INSERT INTO num_exp_mul VALUES (8,2,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (8,2,'-.00218067233500788615');
+INSERT INTO num_exp_add VALUES (8,3,'74885.31');
+INSERT INTO num_exp_sub VALUES (8,3,'74876.69');
+INSERT INTO num_exp_mul VALUES (8,3,'322737.11');
+INSERT INTO num_exp_div VALUES (8,3,'17373.78190255220417633410');
+INSERT INTO num_exp_add VALUES (8,4,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (8,4,'-7724580.4119');
+INSERT INTO num_exp_mul VALUES (8,4,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (8,4,'.00960079113741758956');
+INSERT INTO num_exp_add VALUES (8,5,'91278.038491');
+INSERT INTO num_exp_sub VALUES (8,5,'58483.961509');
+INSERT INTO num_exp_mul VALUES (8,5,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (8,5,'4.56673929509287019456');
+INSERT INTO num_exp_add VALUES (8,6,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (8,6,'-19020.57763026');
+INSERT INTO num_exp_mul VALUES (8,6,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (8,6,'.79744134113322314424');
+INSERT INTO num_exp_add VALUES (8,7,'-82953604');
+INSERT INTO num_exp_sub VALUES (8,7,'83103366');
+INSERT INTO num_exp_mul VALUES (8,7,'-6217255985285');
+INSERT INTO num_exp_div VALUES (8,7,'-.00090187120721280172');
+INSERT INTO num_exp_add VALUES (8,8,'149762');
+INSERT INTO num_exp_sub VALUES (8,8,'0');
+INSERT INTO num_exp_mul VALUES (8,8,'5607164161');
+INSERT INTO num_exp_div VALUES (8,8,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (8,9,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (8,9,'25001685.045047420');
+INSERT INTO num_exp_mul VALUES (8,9,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (8,9,'-.00300403532938582735');
+INSERT INTO num_exp_add VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,0,'0');
+INSERT INTO num_exp_div VALUES (9,0,'NaN');
+INSERT INTO num_exp_add VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,1,'0');
+INSERT INTO num_exp_div VALUES (9,1,'NaN');
+INSERT INTO num_exp_add VALUES (9,2,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (9,2,'9411688.170349627');
+INSERT INTO num_exp_mul VALUES (9,2,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (9,2,'.72591434384152961526');
+INSERT INTO num_exp_add VALUES (9,3,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (9,3,'-24926808.355047420');
+INSERT INTO num_exp_mul VALUES (9,3,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (9,3,'-5783481.21694835730858468677');
+INSERT INTO num_exp_add VALUES (9,4,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (9,4,'-32726265.456947420');
+INSERT INTO num_exp_mul VALUES (9,4,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (9,4,'-3.19596478892958416484');
+INSERT INTO num_exp_add VALUES (9,5,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (9,5,'-24943201.083538420');
+INSERT INTO num_exp_mul VALUES (9,5,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (9,5,'-1520.20159364322004505807');
+INSERT INTO num_exp_add VALUES (9,6,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (9,6,'-25020705.622677680');
+INSERT INTO num_exp_mul VALUES (9,6,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (9,6,'-265.45671195426965751280');
+INSERT INTO num_exp_add VALUES (9,7,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (9,7,'58101680.954952580');
+INSERT INTO num_exp_mul VALUES (9,7,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (9,7,'.30021990699995814689');
+INSERT INTO num_exp_add VALUES (9,8,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (9,8,'-25001685.045047420');
+INSERT INTO num_exp_mul VALUES (9,8,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (9,8,'-332.88556569820675471748');
+INSERT INTO num_exp_add VALUES (9,9,'-49853608.090094840');
+INSERT INTO num_exp_sub VALUES (9,9,'0');
+INSERT INTO num_exp_mul VALUES (9,9,'621345559900192.420120630048656400');
+INSERT INTO num_exp_div VALUES (9,9,'1.00000000000000000000');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_sqrt VALUES (0,'0');
+INSERT INTO num_exp_sqrt VALUES (1,'0');
+INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505');
+INSERT INTO num_exp_sqrt VALUES (3,'2.07605394920266944396');
+INSERT INTO num_exp_sqrt VALUES (4,'2792.75158435189147418923');
+INSERT INTO num_exp_sqrt VALUES (5,'128.05092147657509145473');
+INSERT INTO num_exp_sqrt VALUES (6,'306.43364311096782703406');
+INSERT INTO num_exp_sqrt VALUES (7,'9111.99676251039939975230');
+INSERT INTO num_exp_sqrt VALUES (8,'273.64392922189960397542');
+INSERT INTO num_exp_sqrt VALUES (9,'4992.67503899937593364766');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_ln VALUES (0,'NaN');
+INSERT INTO num_exp_ln VALUES (1,'NaN');
+INSERT INTO num_exp_ln VALUES (2,'17.35177750493897715514');
+INSERT INTO num_exp_ln VALUES (3,'1.46093790411565641971');
+INSERT INTO num_exp_ln VALUES (4,'15.86956523951936572464');
+INSERT INTO num_exp_ln VALUES (5,'9.70485601768871834038');
+INSERT INTO num_exp_ln VALUES (6,'11.45000246622944403127');
+INSERT INTO num_exp_ln VALUES (7,'18.23469429965478772991');
+INSERT INTO num_exp_ln VALUES (8,'11.22365546576315513668');
+INSERT INTO num_exp_ln VALUES (9,'17.03145425013166006962');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_log10 VALUES (0,'NaN');
+INSERT INTO num_exp_log10 VALUES (1,'NaN');
+INSERT INTO num_exp_log10 VALUES (2,'7.53578122160797276459');
+INSERT INTO num_exp_log10 VALUES (3,'.63447727016073160075');
+INSERT INTO num_exp_log10 VALUES (4,'6.89206461372691743345');
+INSERT INTO num_exp_log10 VALUES (5,'4.21476541614777768626');
+INSERT INTO num_exp_log10 VALUES (6,'4.97267288886207207671');
+INSERT INTO num_exp_log10 VALUES (7,'7.91922711353275546914');
+INSERT INTO num_exp_log10 VALUES (8,'4.87437163556421004138');
+INSERT INTO num_exp_log10 VALUES (9,'7.39666659961986567059');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (2,'224790267919917955.13261618583642653184');
+INSERT INTO num_exp_power_10_ln VALUES (3,'28.90266599445155957393');
+INSERT INTO num_exp_power_10_ln VALUES (4,'7405685069594999.07733999469386277636');
+INSERT INTO num_exp_power_10_ln VALUES (5,'5068226527.32127265408584640098');
+INSERT INTO num_exp_power_10_ln VALUES (6,'281839893606.99372343357047819067');
+INSERT INTO num_exp_power_10_ln VALUES (7,'1716699575118597095.42330819910640247627');
+INSERT INTO num_exp_power_10_ln VALUES (8,'167361463828.07491320069016125952');
+INSERT INTO num_exp_power_10_ln VALUES (9,'107511333880052007.04141124673540337457');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_data VALUES (0, '0');
+INSERT INTO num_data VALUES (1, '0');
+INSERT INTO num_data VALUES (2, '-34338492.215397047');
+INSERT INTO num_data VALUES (3, '4.31');
+INSERT INTO num_data VALUES (4, '7799461.4119');
+INSERT INTO num_data VALUES (5, '16397.038491');
+INSERT INTO num_data VALUES (6, '93901.57763026');
+INSERT INTO num_data VALUES (7, '-83028485');
+INSERT INTO num_data VALUES (8, '74881');
+INSERT INTO num_data VALUES (9, '-24926804.045047420');
+COMMIT TRANSACTION;
+-- ******************************
+-- * Create indices for faster checks
+-- ******************************
+CREATE UNIQUE INDEX num_exp_add_idx ON num_exp_add (id1, id2);
+CREATE UNIQUE INDEX num_exp_sub_idx ON num_exp_sub (id1, id2);
+CREATE UNIQUE INDEX num_exp_div_idx ON num_exp_div (id1, id2);
+CREATE UNIQUE INDEX num_exp_mul_idx ON num_exp_mul (id1, id2);
+CREATE UNIQUE INDEX num_exp_sqrt_idx ON num_exp_sqrt (id);
+CREATE UNIQUE INDEX num_exp_ln_idx ON num_exp_ln (id);
+CREATE UNIQUE INDEX num_exp_log10_idx ON num_exp_log10 (id);
+CREATE UNIQUE INDEX num_exp_power_10_ln_idx ON num_exp_power_10_ln (id);
+VACUUM ANALYZE num_exp_add;
+VACUUM ANALYZE num_exp_sub;
+VACUUM ANALYZE num_exp_div;
+VACUUM ANALYZE num_exp_mul;
+VACUUM ANALYZE num_exp_sqrt;
+VACUUM ANALYZE num_exp_ln;
+VACUUM ANALYZE num_exp_log10;
+VACUUM ANALYZE num_exp_power_10_ln;
+-- ******************************
+-- * Now check the behaviour of the NUMERIC type
+-- ******************************
+-- ******************************
+-- * Addition check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val + t2.val
FROM num_data t1, num_data t2;
-QUERY: SELECT t1.id1, t1.id2, t1.result, t2.expected
+SELECT t1.id1, t1.id2, t1.result, t2.expected
FROM num_result t1, num_exp_add t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != t2.expected;
-id1|id2|result|expected
----+---+------+--------
+ id1 | id2 | result | expected
+-----+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
FROM num_data t1, num_data t2;
-QUERY: SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
FROM num_result t1, num_exp_add t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != round(t2.expected, 10);
-id1|id2|result|expected
----+---+------+--------
+ id1 | id2 | result | expected
+-----+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, t1.val - t2.val
+-- ******************************
+-- * Subtraction check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val - t2.val
FROM num_data t1, num_data t2;
-QUERY: SELECT t1.id1, t1.id2, t1.result, t2.expected
+SELECT t1.id1, t1.id2, t1.result, t2.expected
FROM num_result t1, num_exp_sub t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != t2.expected;
-id1|id2|result|expected
----+---+------+--------
+ id1 | id2 | result | expected
+-----+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
FROM num_data t1, num_data t2;
-QUERY: SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
FROM num_result t1, num_exp_sub t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != round(t2.expected, 40);
-id1|id2|result|round
----+---+------+-----
+ id1 | id2 | result | round
+-----+-----+--------+-------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, t1.val * t2.val
+-- ******************************
+-- * Multiply check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val * t2.val
FROM num_data t1, num_data t2;
-QUERY: SELECT t1.id1, t1.id2, t1.result, t2.expected
+SELECT t1.id1, t1.id2, t1.result, t2.expected
FROM num_result t1, num_exp_mul t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != t2.expected;
-id1|id2|result|expected
----+---+------+--------
+ id1 | id2 | result | expected
+-----+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
FROM num_data t1, num_data t2;
-QUERY: SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
FROM num_result t1, num_exp_mul t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != round(t2.expected, 30);
-id1|id2|result|expected
----+---+------+--------
+ id1 | id2 | result | expected
+-----+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
+-- ******************************
+-- * Division check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
FROM num_data t1, num_data t2
WHERE t2.val != '0.0';
-QUERY: SELECT t1.id1, t1.id2, t1.result, t2.expected
+SELECT t1.id1, t1.id2, t1.result, t2.expected
FROM num_result t1, num_exp_div t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != t2.expected;
-id1|id2|result|expected
----+---+------+--------
+ id1 | id2 | result | expected
+-----+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
FROM num_data t1, num_data t2
WHERE t2.val != '0.0';
-QUERY: SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
FROM num_result t1, num_exp_div t2
WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
AND t1.result != round(t2.expected, 80);
-id1|id2|result|expected
----+---+------+--------
+ id1 | id2 | result | expected
+-----+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT id, 0, SQRT(ABS(val))
+-- ******************************
+-- * Square root check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, SQRT(ABS(val))
FROM num_data;
-QUERY: SELECT t1.id1, t1.result, t2.expected
+SELECT t1.id1, t1.result, t2.expected
FROM num_result t1, num_exp_sqrt t2
WHERE t1.id1 = t2.id
AND t1.result != t2.expected;
-id1|result|expected
----+------+--------
+ id1 | result | expected
+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT id, 0, LN(ABS(val))
+-- ******************************
+-- * Natural logarithm check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, LN(ABS(val))
FROM num_data
WHERE val != '0.0';
-QUERY: SELECT t1.id1, t1.result, t2.expected
+SELECT t1.id1, t1.result, t2.expected
FROM num_result t1, num_exp_ln t2
WHERE t1.id1 = t2.id
AND t1.result != t2.expected;
-id1|result|expected
----+------+--------
+ id1 | result | expected
+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT id, 0, LOG('10'::numeric, ABS(val))
+-- ******************************
+-- * Logarithm base 10 check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, LOG(numeric '10', ABS(val))
FROM num_data
WHERE val != '0.0';
-QUERY: SELECT t1.id1, t1.result, t2.expected
+SELECT t1.id1, t1.result, t2.expected
FROM num_result t1, num_exp_log10 t2
WHERE t1.id1 = t2.id
AND t1.result != t2.expected;
-id1|result|expected
----+------+--------
+ id1 | result | expected
+-----+--------+----------
(0 rows)
-QUERY: DELETE FROM num_result;
-QUERY: INSERT INTO num_result SELECT id, 0, POWER('10'::numeric, LN(ABS(round(val,200))))
+-- ******************************
+-- * POWER(10, LN(value)) check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200))))
FROM num_data
WHERE val != '0.0';
-QUERY: SELECT t1.id1, t1.result, t2.expected
+SELECT t1.id1, t1.result, t2.expected
FROM num_result t1, num_exp_power_10_ln t2
WHERE t1.id1 = t2.id
AND t1.result != t2.expected;
-id1|result|expected
----+------+--------
+ id1 | result | expected
+-----+--------+----------
(0 rows)
-QUERY: CREATE TABLE TEMP_FLOAT (f1 FLOAT8);
-QUERY: INSERT INTO TEMP_FLOAT (f1)
+--
+-- NUMEROLOGY
+-- Test various combinations of numeric types and functions.
+--
+--
+-- Test implicit type conversions
+-- This fails for Postgres v6.1 (and earlier?)
+-- so let's try explicit conversions for now - tgl 97/05/07
+--
+CREATE TABLE TEMP_FLOAT (f1 FLOAT8);
+INSERT INTO TEMP_FLOAT (f1)
SELECT float8(f1) FROM INT4_TBL;
-QUERY: INSERT INTO TEMP_FLOAT (f1)
+INSERT INTO TEMP_FLOAT (f1)
SELECT float8(f1) FROM INT2_TBL;
-QUERY: SELECT '' AS ten, f1 FROM TEMP_FLOAT
+SELECT '' AS ten, f1 FROM TEMP_FLOAT
ORDER BY f1;
-ten| f1
----+-----------
- |-2147483647
- | -123456
- | -32767
- | -1234
- | 0
- | 0
- | 1234
- | 32767
- | 123456
- | 2147483647
+ ten | f1
+-----+-------------
+ | -2147483647
+ | -123456
+ | -32767
+ | -1234
+ | 0
+ | 0
+ | 1234
+ | 32767
+ | 123456
+ | 2147483647
(10 rows)
-QUERY: CREATE TABLE TEMP_INT4 (f1 INT4);
-QUERY: INSERT INTO TEMP_INT4 (f1)
+-- int4
+CREATE TABLE TEMP_INT4 (f1 INT4);
+INSERT INTO TEMP_INT4 (f1)
SELECT int4(f1) FROM FLOAT8_TBL
WHERE (f1 > -2147483647) AND (f1 < 2147483647);
-QUERY: INSERT INTO TEMP_INT4 (f1)
+INSERT INTO TEMP_INT4 (f1)
SELECT int4(f1) FROM INT2_TBL;
-QUERY: SELECT '' AS nine, f1 FROM TEMP_INT4
+SELECT '' AS nine, f1 FROM TEMP_INT4
ORDER BY f1;
-nine| f1
-----+------
- |-32767
- | -1234
- | -1004
- | -35
- | 0
- | 0
- | 0
- | 1234
- | 32767
+ nine | f1
+------+--------
+ | -32767
+ | -1234
+ | -1004
+ | -35
+ | 0
+ | 0
+ | 0
+ | 1234
+ | 32767
(9 rows)
-QUERY: CREATE TABLE TEMP_INT2 (f1 INT2);
-QUERY: INSERT INTO TEMP_INT2 (f1)
+-- int2
+CREATE TABLE TEMP_INT2 (f1 INT2);
+INSERT INTO TEMP_INT2 (f1)
SELECT int2(f1) FROM FLOAT8_TBL
WHERE (f1 >= -32767) AND (f1 <= 32767);
-QUERY: INSERT INTO TEMP_INT2 (f1)
+INSERT INTO TEMP_INT2 (f1)
SELECT int2(f1) FROM INT4_TBL
WHERE (f1 >= -32767) AND (f1 <= 32767);
-QUERY: SELECT '' AS five, f1 FROM TEMP_INT2
+SELECT '' AS five, f1 FROM TEMP_INT2
ORDER BY f1;
-five| f1
-----+-----
- |-1004
- | -35
- | 0
- | 0
- | 0
+ five | f1
+------+-------
+ | -1004
+ | -35
+ | 0
+ | 0
+ | 0
(5 rows)
-QUERY: CREATE TABLE TEMP_GROUP (f1 INT4, f2 INT4, f3 FLOAT8);
-QUERY: INSERT INTO TEMP_GROUP
+--
+-- Group-by combinations
+--
+CREATE TABLE TEMP_GROUP (f1 INT4, f2 INT4, f3 FLOAT8);
+INSERT INTO TEMP_GROUP
SELECT 1, (- i.f1), (- f.f1)
FROM INT4_TBL i, FLOAT8_TBL f;
-QUERY: INSERT INTO TEMP_GROUP
+INSERT INTO TEMP_GROUP
SELECT 2, i.f1, f.f1
FROM INT4_TBL i, FLOAT8_TBL f;
-QUERY: SELECT DISTINCT f1 AS two FROM TEMP_GROUP;
-two
----
- 1
- 2
+SELECT DISTINCT f1 AS two FROM TEMP_GROUP;
+ two
+-----
+ 1
+ 2
(2 rows)
-QUERY: SELECT f1 AS two, max(f3) AS max_float, min(f3) as min_float
+SELECT f1 AS two, max(f3) AS max_float, min(f3) as min_float
FROM TEMP_GROUP
GROUP BY two
ORDER BY two, max_float, min_float;
-two|max_float |min_float
----+--------------------+---------------------
- 1|1.2345678901234e+200|0
- 2|0 |-1.2345678901234e+200
+ two | max_float | min_float
+-----+----------------------+-----------------------
+ 1 | 1.2345678901234e+200 | 0
+ 2 | 0 | -1.2345678901234e+200
(2 rows)
-QUERY: SELECT f1 AS two, max(f3) AS max_float, min(f3) AS min_float
+SELECT f1 AS two, max(f3) AS max_float, min(f3) AS min_float
FROM TEMP_GROUP
GROUP BY two
ORDER BY two, max_float, min_float;
-two|max_float |min_float
----+--------------------+---------------------
- 1|1.2345678901234e+200|0
- 2|0 |-1.2345678901234e+200
+ two | max_float | min_float
+-----+----------------------+-----------------------
+ 1 | 1.2345678901234e+200 | 0
+ 2 | 0 | -1.2345678901234e+200
(2 rows)
-QUERY: SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
+SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
FROM TEMP_GROUP
GROUP BY two
ORDER BY two, min_minus_1;
-two|max_plus_1 |min_minus_1
----+--------------------+---------------------
- 1|1.2345678901234e+200|-1
- 2|1 |-1.2345678901234e+200
+ two | max_plus_1 | min_minus_1
+-----+----------------------+-----------------------
+ 1 | 1.2345678901234e+200 | -1
+ 2 | 1 | -1.2345678901234e+200
(2 rows)
-QUERY: SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
+SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
FROM TEMP_GROUP
GROUP BY two
ORDER BY two, min_minus_1;
-two|max_plus_1 |min_minus_1
----+--------------------+---------------------
- 1|1.2345678901234e+200|-1
- 2|1 |-1.2345678901234e+200
+ two | max_plus_1 | min_minus_1
+-----+----------------------+-----------------------
+ 1 | 1.2345678901234e+200 | -1
+ 2 | 1 | -1.2345678901234e+200
(2 rows)
-QUERY: DROP TABLE TEMP_INT2;
-QUERY: DROP TABLE TEMP_INT4;
-QUERY: DROP TABLE TEMP_FLOAT;
-QUERY: DROP TABLE TEMP_GROUP;
+DROP TABLE TEMP_INT2;
+DROP TABLE TEMP_INT4;
+DROP TABLE TEMP_FLOAT;
+DROP TABLE TEMP_GROUP;
-QUERY: SELECT oid, pg_aggregate.aggtransfn1
-FROM pg_aggregate
-WHERE pg_aggregate.aggtransfn1 != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggtransfn1);
-oid|aggtransfn1
----+-----------
-(0 rows)
-
-QUERY: SELECT oid, pg_aggregate.aggtransfn2
-FROM pg_aggregate
-WHERE pg_aggregate.aggtransfn2 != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggtransfn2);
-oid|aggtransfn2
----+-----------
-(0 rows)
-
-QUERY: SELECT oid, pg_aggregate.aggfinalfn
-FROM pg_aggregate
-WHERE pg_aggregate.aggfinalfn != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggfinalfn);
-oid|aggfinalfn
----+----------
-(0 rows)
-
-QUERY: SELECT oid, pg_aggregate.aggbasetype
-FROM pg_aggregate
-WHERE pg_aggregate.aggbasetype != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggbasetype);
-oid|aggbasetype
----+-----------
-(0 rows)
-
-QUERY: SELECT oid, pg_aggregate.aggtranstype1
-FROM pg_aggregate
-WHERE pg_aggregate.aggtranstype1 != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggtranstype1);
-oid|aggtranstype1
----+-------------
-(0 rows)
-
-QUERY: SELECT oid, pg_aggregate.aggtranstype2
-FROM pg_aggregate
-WHERE pg_aggregate.aggtranstype2 != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggtranstype2);
-oid|aggtranstype2
----+-------------
-(0 rows)
-
-QUERY: SELECT oid, pg_aggregate.aggfinaltype
-FROM pg_aggregate
-WHERE pg_aggregate.aggfinaltype != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggfinaltype);
-oid|aggfinaltype
----+------------
-(0 rows)
-
-QUERY: SELECT oid, pg_am.amgettuple
-FROM pg_am
-WHERE pg_am.amgettuple != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amgettuple);
-oid|amgettuple
----+----------
-(0 rows)
-
-QUERY: SELECT oid, pg_am.aminsert
-FROM pg_am
-WHERE pg_am.aminsert != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.aminsert);
-oid|aminsert
----+--------
-(0 rows)
-
-QUERY: SELECT oid, pg_am.amdelete
-FROM pg_am
-WHERE pg_am.amdelete != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amdelete);
-oid|amdelete
----+--------
-(0 rows)
-
-QUERY: SELECT oid, pg_am.ambeginscan
-FROM pg_am
-WHERE pg_am.ambeginscan != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambeginscan);
-oid|ambeginscan
----+-----------
-(0 rows)
-
-QUERY: SELECT oid, pg_am.amrescan
-FROM pg_am
-WHERE pg_am.amrescan != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrescan);
-oid|amrescan
----+--------
-(0 rows)
-
-QUERY: SELECT oid, pg_am.amendscan
-FROM pg_am
-WHERE pg_am.amendscan != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amendscan);
-oid|amendscan
----+---------
+--
+-- OIDJOIN
+-- This is created by pgsql/contrib/findoidjoins/make_oidjoin_check
+--
+SELECT oid, pg_aggregate.aggtransfn1
+ FROM pg_aggregate
+ WHERE pg_aggregate.aggtransfn1 != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggtransfn1);
+ oid | aggtransfn1
+-----+-------------
+(0 rows)
+
+SELECT oid, pg_aggregate.aggtransfn2
+ FROM pg_aggregate
+ WHERE pg_aggregate.aggtransfn2 != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggtransfn2);
+ oid | aggtransfn2
+-----+-------------
+(0 rows)
+
+SELECT oid, pg_aggregate.aggfinalfn
+ FROM pg_aggregate
+ WHERE pg_aggregate.aggfinalfn != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggfinalfn);
+ oid | aggfinalfn
+-----+------------
+(0 rows)
+
+SELECT oid, pg_aggregate.aggbasetype
+ FROM pg_aggregate
+ WHERE pg_aggregate.aggbasetype != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggbasetype);
+ oid | aggbasetype
+-----+-------------
+(0 rows)
+
+SELECT oid, pg_aggregate.aggtranstype1
+ FROM pg_aggregate
+ WHERE pg_aggregate.aggtranstype1 != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggtranstype1);
+ oid | aggtranstype1
+-----+---------------
+(0 rows)
+
+SELECT oid, pg_aggregate.aggtranstype2
+ FROM pg_aggregate
+ WHERE pg_aggregate.aggtranstype2 != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggtranstype2);
+ oid | aggtranstype2
+-----+---------------
+(0 rows)
+
+SELECT oid, pg_aggregate.aggfinaltype
+ FROM pg_aggregate
+ WHERE pg_aggregate.aggfinaltype != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggfinaltype);
+ oid | aggfinaltype
+-----+--------------
+(0 rows)
+
+SELECT oid, pg_am.amgettuple
+ FROM pg_am
+ WHERE pg_am.amgettuple != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amgettuple);
+ oid | amgettuple
+-----+------------
+(0 rows)
+
+SELECT oid, pg_am.aminsert
+ FROM pg_am
+ WHERE pg_am.aminsert != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.aminsert);
+ oid | aminsert
+-----+----------
+(0 rows)
+
+SELECT oid, pg_am.amdelete
+ FROM pg_am
+ WHERE pg_am.amdelete != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amdelete);
+ oid | amdelete
+-----+----------
+(0 rows)
+
+SELECT oid, pg_am.ambeginscan
+ FROM pg_am
+ WHERE pg_am.ambeginscan != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambeginscan);
+ oid | ambeginscan
+-----+-------------
+(0 rows)
+
+SELECT oid, pg_am.amrescan
+ FROM pg_am
+ WHERE pg_am.amrescan != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrescan);
+ oid | amrescan
+-----+----------
+(0 rows)
+
+SELECT oid, pg_am.amendscan
+ FROM pg_am
+ WHERE pg_am.amendscan != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amendscan);
+ oid | amendscan
+-----+-----------
(0 rows)
-QUERY: SELECT oid, pg_am.ammarkpos
-FROM pg_am
-WHERE pg_am.ammarkpos != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ammarkpos);
-oid|ammarkpos
----+---------
+SELECT oid, pg_am.ammarkpos
+ FROM pg_am
+ WHERE pg_am.ammarkpos != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ammarkpos);
+ oid | ammarkpos
+-----+-----------
(0 rows)
-QUERY: SELECT oid, pg_am.amrestrpos
-FROM pg_am
-WHERE pg_am.amrestrpos != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrestrpos);
-oid|amrestrpos
----+----------
+SELECT oid, pg_am.amrestrpos
+ FROM pg_am
+ WHERE pg_am.amrestrpos != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrestrpos);
+ oid | amrestrpos
+-----+------------
(0 rows)
-QUERY: SELECT oid, pg_am.ambuild
-FROM pg_am
-WHERE pg_am.ambuild != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambuild);
-oid|ambuild
----+-------
+SELECT oid, pg_am.ambuild
+ FROM pg_am
+ WHERE pg_am.ambuild != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambuild);
+ oid | ambuild
+-----+---------
(0 rows)
-QUERY: SELECT oid, pg_amop.amopid
-FROM pg_amop
-WHERE pg_amop.amopid != 0 AND
- NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amop.amopid);
-oid|amopid
----+------
+SELECT oid, pg_amop.amopid
+ FROM pg_amop
+ WHERE pg_amop.amopid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amop.amopid);
+ oid | amopid
+-----+--------
(0 rows)
-QUERY: SELECT oid, pg_amop.amopclaid
-FROM pg_amop
-WHERE pg_amop.amopclaid != 0 AND
- NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amop.amopclaid);
-oid|amopclaid
----+---------
+SELECT oid, pg_amop.amopclaid
+ FROM pg_amop
+ WHERE pg_amop.amopclaid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amop.amopclaid);
+ oid | amopclaid
+-----+-----------
(0 rows)
-QUERY: SELECT oid, pg_amop.amopopr
-FROM pg_amop
-WHERE pg_amop.amopopr != 0 AND
- NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_amop.amopopr);
-oid|amopopr
----+-------
+SELECT oid, pg_amop.amopopr
+ FROM pg_amop
+ WHERE pg_amop.amopopr != 0 AND
+ NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_amop.amopopr);
+ oid | amopopr
+-----+---------
(0 rows)
-QUERY: SELECT oid, pg_amop.amopselect
-FROM pg_amop
-WHERE pg_amop.amopselect != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amop.amopselect);
-oid|amopselect
----+----------
+SELECT oid, pg_amop.amopselect
+ FROM pg_amop
+ WHERE pg_amop.amopselect != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amop.amopselect);
+ oid | amopselect
+-----+------------
(0 rows)
-QUERY: SELECT oid, pg_amop.amopnpages
-FROM pg_amop
-WHERE pg_amop.amopnpages != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amop.amopnpages);
-oid|amopnpages
----+----------
+SELECT oid, pg_amop.amopnpages
+ FROM pg_amop
+ WHERE pg_amop.amopnpages != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amop.amopnpages);
+ oid | amopnpages
+-----+------------
(0 rows)
-QUERY: SELECT oid, pg_amproc.amid
-FROM pg_amproc
-WHERE pg_amproc.amid != 0 AND
- NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amproc.amid);
-oid|amid
----+----
+SELECT oid, pg_amproc.amid
+ FROM pg_amproc
+ WHERE pg_amproc.amid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amproc.amid);
+ oid | amid
+-----+------
(0 rows)
-QUERY: SELECT oid, pg_amproc.amopclaid
-FROM pg_amproc
-WHERE pg_amproc.amopclaid != 0 AND
- NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amproc.amopclaid);
-oid|amopclaid
----+---------
+SELECT oid, pg_amproc.amopclaid
+ FROM pg_amproc
+ WHERE pg_amproc.amopclaid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amproc.amopclaid);
+ oid | amopclaid
+-----+-----------
(0 rows)
-QUERY: SELECT oid, pg_amproc.amproc
-FROM pg_amproc
-WHERE pg_amproc.amproc != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amproc.amproc);
-oid|amproc
----+------
+SELECT oid, pg_amproc.amproc
+ FROM pg_amproc
+ WHERE pg_amproc.amproc != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amproc.amproc);
+ oid | amproc
+-----+--------
(0 rows)
-QUERY: SELECT oid, pg_attribute.attrelid
-FROM pg_attribute
-WHERE pg_attribute.attrelid != 0 AND
- NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_attribute.attrelid);
-oid|attrelid
----+--------
+SELECT oid, pg_attribute.attrelid
+ FROM pg_attribute
+ WHERE pg_attribute.attrelid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_attribute.attrelid);
+ oid | attrelid
+-----+----------
(0 rows)
-QUERY: SELECT oid, pg_attribute.atttypid
-FROM pg_attribute
-WHERE pg_attribute.atttypid != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_attribute.atttypid);
-oid|atttypid
----+--------
+SELECT oid, pg_attribute.atttypid
+ FROM pg_attribute
+ WHERE pg_attribute.atttypid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_attribute.atttypid);
+ oid | atttypid
+-----+----------
(0 rows)
-QUERY: SELECT oid, pg_class.reltype
-FROM pg_class
-WHERE pg_class.reltype != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_class.reltype);
-oid|reltype
----+-------
+SELECT oid, pg_class.reltype
+ FROM pg_class
+ WHERE pg_class.reltype != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_class.reltype);
+ oid | reltype
+-----+---------
(0 rows)
-QUERY: SELECT oid, pg_class.relam
-FROM pg_class
-WHERE pg_class.relam != 0 AND
- NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_class.relam);
-oid|relam
----+-----
+SELECT oid, pg_class.relam
+ FROM pg_class
+ WHERE pg_class.relam != 0 AND
+ NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_class.relam);
+ oid | relam
+-----+-------
(0 rows)
-QUERY: SELECT oid, pg_index.indexrelid
-FROM pg_index
-WHERE pg_index.indexrelid != 0 AND
- NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indexrelid);
-oid|indexrelid
----+----------
+SELECT oid, pg_index.indexrelid
+ FROM pg_index
+ WHERE pg_index.indexrelid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indexrelid);
+ oid | indexrelid
+-----+------------
(0 rows)
-QUERY: SELECT oid, pg_index.indrelid
-FROM pg_index
-WHERE pg_index.indrelid != 0 AND
- NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indrelid);
-oid|indrelid
----+--------
+SELECT oid, pg_index.indrelid
+ FROM pg_index
+ WHERE pg_index.indrelid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indrelid);
+ oid | indrelid
+-----+----------
(0 rows)
-QUERY: SELECT oid, pg_opclass.opcdeftype
-FROM pg_opclass
-WHERE pg_opclass.opcdeftype != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_opclass.opcdeftype);
-oid|opcdeftype
----+----------
+SELECT oid, pg_opclass.opcdeftype
+ FROM pg_opclass
+ WHERE pg_opclass.opcdeftype != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_opclass.opcdeftype);
+ oid | opcdeftype
+-----+------------
(0 rows)
-QUERY: SELECT oid, pg_operator.oprleft
-FROM pg_operator
-WHERE pg_operator.oprleft != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprleft);
-oid|oprleft
----+-------
+SELECT oid, pg_operator.oprleft
+ FROM pg_operator
+ WHERE pg_operator.oprleft != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprleft);
+ oid | oprleft
+-----+---------
(0 rows)
-QUERY: SELECT oid, pg_operator.oprright
-FROM pg_operator
-WHERE pg_operator.oprright != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprright);
-oid|oprright
----+--------
+SELECT oid, pg_operator.oprright
+ FROM pg_operator
+ WHERE pg_operator.oprright != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprright);
+ oid | oprright
+-----+----------
(0 rows)
-QUERY: SELECT oid, pg_operator.oprresult
-FROM pg_operator
-WHERE pg_operator.oprresult != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprresult);
-oid|oprresult
----+---------
+SELECT oid, pg_operator.oprresult
+ FROM pg_operator
+ WHERE pg_operator.oprresult != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprresult);
+ oid | oprresult
+-----+-----------
(0 rows)
-QUERY: SELECT oid, pg_operator.oprcom
-FROM pg_operator
-WHERE pg_operator.oprcom != 0 AND
- NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprcom);
-oid|oprcom
----+------
+SELECT oid, pg_operator.oprcom
+ FROM pg_operator
+ WHERE pg_operator.oprcom != 0 AND
+ NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprcom);
+ oid | oprcom
+-----+--------
(0 rows)
-QUERY: SELECT oid, pg_operator.oprnegate
-FROM pg_operator
-WHERE pg_operator.oprnegate != 0 AND
- NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprnegate);
-oid|oprnegate
----+---------
+SELECT oid, pg_operator.oprnegate
+ FROM pg_operator
+ WHERE pg_operator.oprnegate != 0 AND
+ NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprnegate);
+ oid | oprnegate
+-----+-----------
(0 rows)
-QUERY: SELECT oid, pg_operator.oprlsortop
-FROM pg_operator
-WHERE pg_operator.oprlsortop != 0 AND
- NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprlsortop);
-oid|oprlsortop
----+----------
+SELECT oid, pg_operator.oprlsortop
+ FROM pg_operator
+ WHERE pg_operator.oprlsortop != 0 AND
+ NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprlsortop);
+ oid | oprlsortop
+-----+------------
(0 rows)
-QUERY: SELECT oid, pg_operator.oprrsortop
-FROM pg_operator
-WHERE pg_operator.oprrsortop != 0 AND
- NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprrsortop);
-oid|oprrsortop
----+----------
-(0 rows)
+SELECT oid, pg_operator.oprrsortop
+ FROM pg_operator
+ WHERE pg_operator.oprrsortop != 0 AND
+ NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprrsortop);
+ oid | oprrsortop
+-----+------------
+(0 rows)
-QUERY: SELECT oid, pg_operator.oprcode
-FROM pg_operator
-WHERE pg_operator.oprcode != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprcode);
-oid|oprcode
----+-------
-(0 rows)
+SELECT oid, pg_operator.oprcode
+ FROM pg_operator
+ WHERE pg_operator.oprcode != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprcode);
+ oid | oprcode
+-----+---------
+(0 rows)
-QUERY: SELECT oid, pg_operator.oprrest
-FROM pg_operator
-WHERE pg_operator.oprrest != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprrest);
-oid|oprrest
----+-------
-(0 rows)
+SELECT oid, pg_operator.oprrest
+ FROM pg_operator
+ WHERE pg_operator.oprrest != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprrest);
+ oid | oprrest
+-----+---------
+(0 rows)
-QUERY: SELECT oid, pg_operator.oprjoin
-FROM pg_operator
-WHERE pg_operator.oprjoin != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprjoin);
-oid|oprjoin
----+-------
-(0 rows)
+SELECT oid, pg_operator.oprjoin
+ FROM pg_operator
+ WHERE pg_operator.oprjoin != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprjoin);
+ oid | oprjoin
+-----+---------
+(0 rows)
-QUERY: SELECT oid, pg_proc.prolang
-FROM pg_proc
-WHERE pg_proc.prolang != 0 AND
- NOT EXISTS(SELECT * FROM pg_language AS t1 WHERE t1.oid = pg_proc.prolang);
-oid|prolang
----+-------
-(0 rows)
+SELECT oid, pg_proc.prolang
+ FROM pg_proc
+ WHERE pg_proc.prolang != 0 AND
+ NOT EXISTS(SELECT * FROM pg_language AS t1 WHERE t1.oid = pg_proc.prolang);
+ oid | prolang
+-----+---------
+(0 rows)
-QUERY: SELECT oid, pg_proc.prorettype
-FROM pg_proc
-WHERE pg_proc.prorettype != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_proc.prorettype);
-oid|prorettype
----+----------
-(0 rows)
+SELECT oid, pg_proc.prorettype
+ FROM pg_proc
+ WHERE pg_proc.prorettype != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_proc.prorettype);
+ oid | prorettype
+-----+------------
+(0 rows)
-QUERY: SELECT oid, pg_rewrite.ev_class
-FROM pg_rewrite
-WHERE pg_rewrite.ev_class != 0 AND
- NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_rewrite.ev_class);
-oid|ev_class
----+--------
-(0 rows)
+SELECT oid, pg_rewrite.ev_class
+ FROM pg_rewrite
+ WHERE pg_rewrite.ev_class != 0 AND
+ NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_rewrite.ev_class);
+ oid | ev_class
+-----+----------
+(0 rows)
-QUERY: SELECT oid, pg_type.typrelid
-FROM pg_type
-WHERE pg_type.typrelid != 0 AND
- NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_type.typrelid);
-oid|typrelid
----+--------
-(0 rows)
+SELECT oid, pg_type.typrelid
+ FROM pg_type
+ WHERE pg_type.typrelid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_type.typrelid);
+ oid | typrelid
+-----+----------
+(0 rows)
-QUERY: SELECT oid, pg_type.typelem
-FROM pg_type
-WHERE pg_type.typelem != 0 AND
- NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_type.typelem);
-oid|typelem
----+-------
-(0 rows)
+SELECT oid, pg_type.typelem
+ FROM pg_type
+ WHERE pg_type.typelem != 0 AND
+ NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_type.typelem);
+ oid | typelem
+-----+---------
+(0 rows)
-QUERY: SELECT oid, pg_type.typinput
-FROM pg_type
-WHERE pg_type.typinput != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typinput);
-oid|typinput
----+--------
-(0 rows)
+SELECT oid, pg_type.typinput
+ FROM pg_type
+ WHERE pg_type.typinput != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typinput);
+ oid | typinput
+-----+----------
+(0 rows)
-QUERY: SELECT oid, pg_type.typoutput
-FROM pg_type
-WHERE pg_type.typoutput != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typoutput);
-oid|typoutput
----+---------
-(0 rows)
+SELECT oid, pg_type.typoutput
+ FROM pg_type
+ WHERE pg_type.typoutput != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typoutput);
+ oid | typoutput
+-----+-----------
+(0 rows)
-QUERY: SELECT oid, pg_type.typreceive
-FROM pg_type
-WHERE pg_type.typreceive != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typreceive);
-oid|typreceive
----+----------
-(0 rows)
+SELECT oid, pg_type.typreceive
+ FROM pg_type
+ WHERE pg_type.typreceive != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typreceive);
+ oid | typreceive
+-----+------------
+(0 rows)
-QUERY: SELECT oid, pg_type.typsend
-FROM pg_type
-WHERE pg_type.typsend != 0 AND
- NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typsend);
-oid|typsend
----+-------
+SELECT oid, pg_type.typsend
+ FROM pg_type
+ WHERE pg_type.typsend != 0 AND
+ NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typsend);
+ oid | typsend
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.proname
+--
+-- OPR_SANITY
+-- Sanity checks for common errors in making operator/procedure system tables:
+-- pg_operator, pg_proc, pg_aggregate, pg_am, pg_amop, pg_amproc, pg_opclass.
+--
+-- None of the SELECTs here should ever find any matching entries,
+-- so the expected output is easy to maintain ;-).
+-- A test failure indicates someone messed up an entry in the system tables.
+--
+-- NB: we assume the oidjoins test will have caught any dangling links,
+-- that is OID or REGPROC fields that are not zero and do not match some
+-- row in the linked-to table. However, if we want to enforce that a link
+-- field can't be 0, we have to check it here.
+--
+-- NB: run this test earlier than the create_operator test, because
+-- that test creates some bogus operators...
+--
+-- NOTE hardwired assumptions about standard types:
+-- type bool has OID 16
+-- type float8 has OID 701
+--
+-- **************** pg_proc ****************
+-- Look for illegal values in pg_proc fields.
+SELECT p1.oid, p1.proname
FROM pg_proc as p1
WHERE (p1.prolang = 0 OR p1.prorettype = 0 OR
p1.pronargs < 0 OR p1.pronargs > 9)
AND p1.proname !~ '^pl[^_]+_call_handler$'
AND p1.proname !~ '^RI_FKey_'
AND p1.proname != 'update_pg_pwd';
-oid|proname
----+-------
+ oid | proname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.proname, p2.oid, p2.proname
+-- Look for conflicting proc definitions (same names and input datatypes).
+SELECT p1.oid, p1.proname, p2.oid, p2.proname
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.proname = p2.proname AND
p1.pronargs = p2.pronargs AND
p1.proargtypes = p2.proargtypes;
-oid|proname|oid|proname
----+-------+---+-------
+ oid | proname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.proname, p2.oid, p2.proname
+-- Considering only built-in procs (prolang = 11), look for multiple uses
+-- of the same internal function (ie, matching prosrc fields). It's OK to
+-- have several entries with different pronames for the same internal function,
+-- but conflicts in the number of arguments and other critical items should
+-- be complained of.
+SELECT p1.oid, p1.proname, p2.oid, p2.proname
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
p1.proiscachable != p2.proiscachable OR
p1.pronargs != p2.pronargs OR
p1.proretset != p2.proretset);
-oid|proname|oid|proname
----+-------+---+-------
+ oid | proname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT DISTINCT p1.prorettype, p2.prorettype
+-- Look for uses of different type OIDs in the argument/result type fields
+-- for different aliases of the same built-in function.
+-- This indicates that the types are being presumed to be binary-equivalent.
+-- That's not wrong, necessarily, but we make lists of all the types being
+-- so treated. Note that the expected output of this part of the test will
+-- need to be modified whenever new pairs of types are made binary-equivalent!
+SELECT DISTINCT p1.prorettype, p2.prorettype
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.prorettype < p2.prorettype);
-prorettype|prorettype
-----------+----------
- 18| 25
- 25| 1043
+ prorettype | prorettype
+------------+------------
+ 18 | 25
+ 25 | 1043
(2 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[0], p2.proargtypes[0]
+SELECT DISTINCT p1.proargtypes[0], p2.proargtypes[0]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[0] < p2.proargtypes[0]);
-proargtypes|proargtypes
------------+-----------
- 25| 1043
- 1042| 1043
+ proargtypes | proargtypes
+-------------+-------------
+ 25 | 1043
+ 1042 | 1043
(2 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[1], p2.proargtypes[1]
+SELECT DISTINCT p1.proargtypes[1], p2.proargtypes[1]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[1] < p2.proargtypes[1]);
-proargtypes|proargtypes
------------+-----------
+ proargtypes | proargtypes
+-------------+-------------
(0 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[2], p2.proargtypes[2]
+SELECT DISTINCT p1.proargtypes[2], p2.proargtypes[2]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[2] < p2.proargtypes[2]);
-proargtypes|proargtypes
------------+-----------
+ proargtypes | proargtypes
+-------------+-------------
(0 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[3], p2.proargtypes[3]
+SELECT DISTINCT p1.proargtypes[3], p2.proargtypes[3]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[3] < p2.proargtypes[3]);
-proargtypes|proargtypes
------------+-----------
+ proargtypes | proargtypes
+-------------+-------------
(0 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[4], p2.proargtypes[4]
+SELECT DISTINCT p1.proargtypes[4], p2.proargtypes[4]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[4] < p2.proargtypes[4]);
-proargtypes|proargtypes
------------+-----------
+ proargtypes | proargtypes
+-------------+-------------
(0 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[5], p2.proargtypes[5]
+SELECT DISTINCT p1.proargtypes[5], p2.proargtypes[5]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[5] < p2.proargtypes[5]);
-proargtypes|proargtypes
------------+-----------
+ proargtypes | proargtypes
+-------------+-------------
(0 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[6], p2.proargtypes[6]
+SELECT DISTINCT p1.proargtypes[6], p2.proargtypes[6]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[6] < p2.proargtypes[6]);
-proargtypes|proargtypes
------------+-----------
+ proargtypes | proargtypes
+-------------+-------------
(0 rows)
-QUERY: SELECT DISTINCT p1.proargtypes[7], p2.proargtypes[7]
+SELECT DISTINCT p1.proargtypes[7], p2.proargtypes[7]
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND
(p1.proargtypes[7] < p2.proargtypes[7]);
-proargtypes|proargtypes
------------+-----------
+ proargtypes | proargtypes
+-------------+-------------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname
+-- **************** pg_operator ****************
+-- Look for illegal values in pg_operator fields.
+SELECT p1.oid, p1.oprname
FROM pg_operator as p1
WHERE (p1.oprkind != 'b' AND p1.oprkind != 'l' AND p1.oprkind != 'r') OR
p1.oprresult = 0 OR p1.oprcode = 0;
-oid|oprname
----+-------
+ oid | oprname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname
+-- Look for missing or unwanted operand types
+SELECT p1.oid, p1.oprname
FROM pg_operator as p1
WHERE (p1.oprleft = 0 and p1.oprkind != 'l') OR
(p1.oprleft != 0 and p1.oprkind = 'l') OR
(p1.oprright = 0 and p1.oprkind != 'r') OR
(p1.oprright != 0 and p1.oprkind = 'r');
-oid|oprname
----+-------
+ oid | oprname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
+-- Look for conflicting operator definitions (same names and input datatypes).
+SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oid != p2.oid AND
p1.oprname = p2.oprname AND
p1.oprkind = p2.oprkind AND
p1.oprleft = p2.oprleft AND
p1.oprright = p2.oprright;
-oid|oprcode|oid|oprcode
----+-------+---+-------
+ oid | oprcode | oid | oprcode
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
+-- Look for commutative operators that don't commute.
+-- DEFINITIONAL NOTE: If A.oprcom = B, then x A y has the same result as y B x.
+-- We expect that B will always say that B.oprcom = A as well; that's not
+-- inherently essential, but it would be inefficient not to mark it so.
+SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oprcom = p2.oid AND
(p1.oprkind != 'b' OR
p1.oprright != p2.oprleft OR
p1.oprresult != p2.oprresult OR
p1.oid != p2.oprcom);
-oid|oprcode|oid|oprcode
----+-------+---+-------
+ oid | oprcode | oid | oprcode
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
+-- Look for negatory operators that don't agree.
+-- DEFINITIONAL NOTE: If A.oprnegate = B, then both A and B must yield
+-- boolean results, and (x A y) == ! (x B y), or the equivalent for
+-- single-operand operators.
+-- We expect that B will always say that B.oprnegate = A as well; that's not
+-- inherently essential, but it would be inefficient not to mark it so.
+SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oprnegate = p2.oid AND
(p1.oprkind != p2.oprkind OR
p1.oprresult != 16 OR
p2.oprresult != 16 OR
p1.oid != p2.oprnegate);
-oid|oprcode|oid|oprcode
----+-------+---+-------
+ oid | oprcode | oid | oprcode
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
+-- Look for mergejoin operators that don't match their links.
+-- A mergejoin link leads from an '=' operator to the
+-- sort operator ('<' operator) that's appropriate for
+-- its left-side or right-side data type.
+SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oprlsortop = p2.oid AND
(p1.oprname != '=' OR p2.oprname != '<' OR
p1.oprresult != 16 OR
p2.oprresult != 16 OR
p1.oprrsortop = 0);
-oid|oprcode|oid|oprcode
----+-------+---+-------
+ oid | oprcode | oid | oprcode
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
+SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oprrsortop = p2.oid AND
(p1.oprname != '=' OR p2.oprname != '<' OR
p1.oprresult != 16 OR
p2.oprresult != 16 OR
p1.oprlsortop = 0);
-oid|oprcode|oid|oprcode
----+-------+---+-------
+ oid | oprcode | oid | oprcode
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname FROM pg_operator AS p1
+-- A mergejoinable = operator must have a commutator (usually itself)
+-- as well as corresponding < and > operators. Note that the "corresponding"
+-- operators have the same L and R input datatypes as the = operator,
+-- whereas the operators linked to by oprlsortop and oprrsortop have input
+-- datatypes L,L and R,R respectively.
+SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE p1.oprlsortop != 0 AND
p1.oprcom = 0;
-oid|oprname
----+-------
+ oid | oprname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname FROM pg_operator AS p1
+SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE p1.oprlsortop != 0 AND NOT
EXISTS(SELECT * FROM pg_operator AS p2 WHERE
p2.oprname = '<' AND
p2.oprleft = p1.oprleft AND
p2.oprright = p1.oprright AND
p2.oprkind = 'b');
-oid|oprname
----+-------
+ oid | oprname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname FROM pg_operator AS p1
+SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE p1.oprlsortop != 0 AND NOT
EXISTS(SELECT * FROM pg_operator AS p2 WHERE
p2.oprname = '>' AND
p2.oprleft = p1.oprleft AND
p2.oprright = p1.oprright AND
p2.oprkind = 'b');
-oid|oprname
----+-------
+ oid | oprname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname
+-- Hashing only works on simple equality operators "type = sametype",
+-- since the hash itself depends on the bitwise representation of the type.
+-- Check that allegedly hashable operators look like they might be "=".
+-- NOTE: in 6.5, this search finds int4eqoid and oideqint4. Until we have
+-- some cleaner way of dealing with binary-equivalent types, just leave
+-- those two tuples in the expected output.
+SELECT p1.oid, p1.oprname
FROM pg_operator AS p1
WHERE p1.oprcanhash AND NOT
(p1.oprkind = 'b' AND p1.oprresult = 16 AND p1.oprleft = p1.oprright AND
p1.oprname = '=' AND p1.oprcom = p1.oid);
- oid|oprname
-----+-------
-1136|=
-1137|=
+ oid | oprname
+------+---------
+ 1136 | =
+ 1137 | =
(2 rows)
-QUERY: SELECT p1.oid, p1.oprname
+-- In 6.5 we accepted hashable array equality operators when the array element
+-- type is hashable. However, what we actually need to make hashjoin work on
+-- an array is a hashable element type *and* no padding between elements in
+-- the array storage (or, perhaps, guaranteed-zero padding). Currently,
+-- since the padding code in arrayfuncs.c is pretty bogus, it seems safest
+-- to just forbid hashjoin on array equality ops.
+-- This should be reconsidered someday.
+-- -- Look for array equality operators that are hashable when the underlying
+-- -- type is not, or vice versa. This is presumably bogus.
+--
+-- SELECT p1.oid, p1.oprcanhash, p2.oid, p2.oprcanhash, t1.typname, t2.typname
+-- FROM pg_operator AS p1, pg_operator AS p2, pg_type AS t1, pg_type AS t2
+-- WHERE p1.oprname = '=' AND p1.oprleft = p1.oprright AND
+-- p2.oprname = '=' AND p2.oprleft = p2.oprright AND
+-- p1.oprleft = t1.oid AND p2.oprleft = t2.oid AND t1.typelem = t2.oid AND
+-- p1.oprcanhash != p2.oprcanhash;
+-- Substitute check: forbid hashable array ops, period.
+SELECT p1.oid, p1.oprname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcanhash AND p1.oprcode = p2.oid AND p2.proname = 'array_eq';
-oid|oprname
----+-------
+ oid | oprname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname, p2.oid, p2.proname
+-- Check that each operator defined in pg_operator matches its oprcode entry
+-- in pg_proc. Easiest to do this separately for each oprkind.
+-- FIXME: want to check that argument/result types match, but how to do that
+-- in the face of binary-compatible types?
+SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcode = p2.oid AND
p1.oprkind = 'b' AND
(p2.pronargs != 2
+-- diked out until we find a way of marking binary-compatible types
+-- OR
+-- p1.oprresult != p2.prorettype OR
+-- (p1.oprleft != p2.proargtypes[0] AND p2.proargtypes[0] != 0) OR
+-- (p1.oprright != p2.proargtypes[1] AND p2.proargtypes[1] != 0)
);
-oid|oprname|oid|proname
----+-------+---+-------
+ oid | oprname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname, p2.oid, p2.proname
+-- These two selects can be left as-is because there are no binary-compatible
+-- cases that they trip over, at least in 6.5:
+SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcode = p2.oid AND
p1.oprkind = 'l' AND
p1.oprresult != p2.prorettype OR
(p1.oprright != p2.proargtypes[0] AND p2.proargtypes[0] != 0) OR
p1.oprleft != 0);
-oid|oprname|oid|proname
----+-------+---+-------
+ oid | oprname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname, p2.oid, p2.proname
+SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcode = p2.oid AND
p1.oprkind = 'r' AND
p1.oprresult != p2.prorettype OR
(p1.oprleft != p2.proargtypes[0] AND p2.proargtypes[0] != 0) OR
p1.oprright != 0);
-oid|oprname|oid|proname
----+-------+---+-------
+ oid | oprname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname, p2.oid, p2.proname
+-- If oprrest is set, the operator must return boolean,
+-- and it must link to a proc with the right signature
+-- to be a restriction selectivity estimator.
+-- The proc signature we want is: float8 proc(oid, oid, int2, <any>, int4)
+SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprrest = p2.oid AND
(p1.oprresult != 16 OR
p2.proargtypes[0] != 26 OR p2.proargtypes[1] != 26 OR
p2.proargtypes[2] != 21 OR p2.proargtypes[3] != 0 OR
p2.proargtypes[4] != 23);
-oid|oprname|oid|proname
----+-------+---+-------
+ oid | oprname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.oprname, p2.oid, p2.proname
+-- If oprjoin is set, the operator must be a binary boolean op,
+-- and it must link to a proc with the right signature
+-- to be a join selectivity estimator.
+-- The proc signature we want is: float8 proc(oid, oid, int2, oid, int2)
+SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprjoin = p2.oid AND
(p1.oprkind != 'b' OR p1.oprresult != 16 OR
p2.proargtypes[0] != 26 OR p2.proargtypes[1] != 26 OR
p2.proargtypes[2] != 21 OR p2.proargtypes[3] != 26 OR
p2.proargtypes[4] != 21);
-oid|oprname|oid|proname
----+-------+---+-------
+ oid | oprname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.aggname
+-- **************** pg_aggregate ****************
+-- Look for illegal values in pg_aggregate fields.
+-- aggbasetype can only be 0 if transfn1 is not present (eg, count(*))
+-- or itself takes a wild-card input; we check the latter case below.
+SELECT p1.oid, p1.aggname
FROM pg_aggregate as p1
WHERE (p1.aggbasetype = 0 AND p1.aggtransfn1 != 0) OR aggfinaltype = 0;
-oid|aggname
----+-------
-(0 rows)
-
-QUERY: SELECT p1.oid, p1.aggname
+ oid | aggname
+-----+---------
+(0 rows)
+
+-- Check combinations of transfer functions.
+-- Although either transfn1 or transfn2 can be null,
+-- it makes no sense for both to be. And if both are defined,
+-- presumably there should be a finalfn to combine their results.
+-- We also check that transtypes are null just when corresponding
+-- transfns are. Also, if there is no finalfn then the output type
+-- must be the transtype the result will be taken from.
+SELECT p1.oid, p1.aggname
FROM pg_aggregate as p1
WHERE p1.aggtransfn1 = 0 AND p1.aggtransfn2 = 0;
-oid|aggname
----+-------
+ oid | aggname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.aggname
+SELECT p1.oid, p1.aggname
FROM pg_aggregate as p1
WHERE p1.aggtransfn1 != 0 AND p1.aggtransfn2 = 0 AND
(p1.aggtranstype1 = 0 OR p1.aggtranstype2 != 0 OR
(p1.aggfinalfn = 0 AND p1.aggfinaltype != p1.aggtranstype1));
-oid|aggname
----+-------
+ oid | aggname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.aggname
+SELECT p1.oid, p1.aggname
FROM pg_aggregate as p1
WHERE p1.aggtransfn1 = 0 AND p1.aggtransfn2 != 0 AND
(p1.aggtranstype1 != 0 OR p1.aggtranstype2 = 0 OR
(p1.aggfinalfn = 0 AND p1.aggfinaltype != p1.aggtranstype2));
-oid|aggname
----+-------
+ oid | aggname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.aggname
+SELECT p1.oid, p1.aggname
FROM pg_aggregate as p1
WHERE p1.aggtransfn1 != 0 AND p1.aggtransfn2 != 0 AND
(p1.aggtranstype1 = 0 OR p1.aggtranstype2 = 0 OR
p1.aggfinalfn = 0);
-oid|aggname
----+-------
+ oid | aggname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.aggname, p2.oid, p2.proname
+-- Cross-check transfn1 (if present) against its entry in pg_proc.
+-- FIXME: what about binary-compatible types?
+SELECT p1.oid, p1.aggname, p2.oid, p2.proname
FROM pg_aggregate AS p1, pg_proc AS p2
WHERE p1.aggtransfn1 = p2.oid AND
(p2.proretset OR p2.pronargs != 2
+-- diked out until we find a way of marking binary-compatible types
+-- OR
+-- p1.aggtranstype1 != p2.prorettype OR
+-- p1.aggtranstype1 != p2.proargtypes[0] OR
+-- p1.aggbasetype != p2.proargtypes[1]
);
-oid|aggname|oid|proname
----+-------+---+-------
+ oid | aggname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.aggname, p2.oid, p2.proname
+-- Cross-check transfn2 (if present) against its entry in pg_proc.
+-- FIXME: what about binary-compatible types?
+SELECT p1.oid, p1.aggname, p2.oid, p2.proname
FROM pg_aggregate AS p1, pg_proc AS p2
WHERE p1.aggtransfn2 = p2.oid AND
(p2.proretset OR p1.aggtranstype2 != p2.prorettype OR
p2.pronargs != 1 OR
p1.aggtranstype2 != p2.proargtypes[0]);
-oid|aggname|oid|proname
----+-------+---+-------
+ oid | aggname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.aggname, p2.oid, p2.proname
+-- Cross-check finalfn (if present) against its entry in pg_proc.
+-- FIXME: what about binary-compatible types?
+SELECT p1.oid, p1.aggname, p2.oid, p2.proname
FROM pg_aggregate AS p1, pg_proc AS p2
WHERE p1.aggfinalfn = p2.oid AND
(p2.proretset OR p1.aggfinaltype != p2.prorettype OR
p2.pronargs != 2 OR
p1.aggtranstype1 != p2.proargtypes[0] OR
p1.aggtranstype2 != p2.proargtypes[1]);
-oid|aggname|oid|proname
----+-------+---+-------
+ oid | aggname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid
+-- **************** pg_amop ****************
+-- Look for illegal values in pg_amop fields
+SELECT p1.oid
FROM pg_amop as p1
WHERE p1.amopid = 0 OR p1.amopclaid = 0 OR p1.amopopr = 0 OR
p1.amopstrategy <= 0 OR p1.amopselect = 0 OR p1.amopnpages = 0;
-oid
----
+ oid
+-----
(0 rows)
-QUERY: SELECT p1.oid, p2.oid
+-- Look for duplicate pg_amop entries
+SELECT p1.oid, p2.oid
FROM pg_amop AS p1, pg_amop AS p2
WHERE p1.oid != p2.oid AND
p1.amopid = p2.amopid AND
p1.amopclaid = p2.amopclaid AND
p1.amopstrategy = p2.amopstrategy;
-oid|oid
----+---
+ oid | oid
+-----+-----
(0 rows)
-QUERY: SELECT p1.oid, p2.oid, p2.amname
+-- Cross-check amopstrategy index against parent AM
+SELECT p1.oid, p2.oid, p2.amname
FROM pg_amop AS p1, pg_am AS p2
WHERE p1.amopid = p2.oid AND p1.amopstrategy > p2.amstrategies;
-oid|oid|amname
----+---+------
+ oid | oid | amname
+-----+-----+--------
(0 rows)
-QUERY: SELECT p1.oid, p1.amname, p2.oid, p2.opcname
+-- Detect missing pg_amop entries: should have as many strategy functions
+-- as AM expects for each opclass, unless there are none at all
+-- (some opclasses only offer support for a limited set of AMs...)
+SELECT p1.oid, p1.amname, p2.oid, p2.opcname
FROM pg_am AS p1, pg_opclass AS p2
WHERE p1.amstrategies != (SELECT count(*) FROM pg_amop AS p3
WHERE p3.amopid = p1.oid AND p3.amopclaid = p2.oid)
AND EXISTS (SELECT * FROM pg_amop AS p3
WHERE p3.amopid = p1.oid AND p3.amopclaid = p2.oid);
-oid|amname|oid|opcname
----+------+---+-------
+ oid | amname | oid | opcname
+-----+--------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p2.oid, p2.oprname
+-- Check that amopopr points at a reasonable-looking operator
+SELECT p1.oid, p2.oid, p2.oprname
FROM pg_amop AS p1, pg_operator AS p2
WHERE p1.amopopr = p2.oid AND
(p2.oprkind != 'b' OR p2.oprresult != 16);
-oid|oid|oprname
----+---+-------
+ oid | oid | oprname
+-----+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p2.oid, p2.oprname, p3.oid, p3.opcname
+-- If opclass is for a specific type, operator inputs should be of that type
+SELECT p1.oid, p2.oid, p2.oprname, p3.oid, p3.opcname
FROM pg_amop AS p1, pg_operator AS p2, pg_opclass AS p3
WHERE p1.amopopr = p2.oid AND p1.amopclaid = p3.oid AND
p3.opcdeftype != 0 AND
(p3.opcdeftype != p2.oprleft OR p3.opcdeftype != p2.oprright);
-oid|oid|oprname|oid|opcname
----+---+-------+---+-------
+ oid | oid | oprname | oid | opcname
+-----+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p2.oid, p2.proname
+-- Check that amopselect points to a proc with the right signature
+-- to be an access-method selectivity estimator.
+-- The proc signature we want is:
+-- float8 proc(oid, oid, int2, <any>, int4, int4, oid)
+SELECT p1.oid, p2.oid, p2.proname
FROM pg_amop AS p1, pg_proc AS p2
WHERE p1.amopselect = p2.oid AND
(p2.prorettype != 701 OR p2.proretset OR
p2.proargtypes[2] != 21 OR p2.proargtypes[3] != 0 OR
p2.proargtypes[4] != 23 OR p2.proargtypes[5] != 23 OR
p2.proargtypes[6] != 26);
-oid|oid|proname
----+---+-------
+ oid | oid | proname
+-----+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p2.oid, p2.proname
+-- Check that amopnpages points to a proc with the right signature
+-- to be an access-method page-count estimator.
+-- The proc signature we want is:
+-- float8 proc(oid, oid, int2, <any>, int4, int4, oid)
+SELECT p1.oid, p2.oid, p2.proname
FROM pg_amop AS p1, pg_proc AS p2
WHERE p1.amopnpages = p2.oid AND
(p2.prorettype != 701 OR p2.proretset OR
p2.proargtypes[2] != 21 OR p2.proargtypes[3] != 0 OR
p2.proargtypes[4] != 23 OR p2.proargtypes[5] != 23 OR
p2.proargtypes[6] != 26);
-oid|oid|proname
----+---+-------
+ oid | oid | proname
+-----+-----+---------
(0 rows)
-QUERY: SELECT p1.oid
+-- **************** pg_amproc ****************
+-- Look for illegal values in pg_amproc fields
+SELECT p1.oid
FROM pg_amproc as p1
WHERE p1.amid = 0 OR p1.amopclaid = 0 OR p1.amproc = 0 OR
p1.amprocnum <= 0;
-oid
----
+ oid
+-----
(0 rows)
-QUERY: SELECT p1.oid, p2.oid
+-- Look for duplicate pg_amproc entries
+SELECT p1.oid, p2.oid
FROM pg_amproc AS p1, pg_amproc AS p2
WHERE p1.oid != p2.oid AND
p1.amid = p2.amid AND
p1.amopclaid = p2.amopclaid AND
p1.amprocnum = p2.amprocnum;
-oid|oid
----+---
+ oid | oid
+-----+-----
(0 rows)
-QUERY: SELECT p1.oid, p2.oid, p2.amname
+-- Cross-check amprocnum index against parent AM
+SELECT p1.oid, p2.oid, p2.amname
FROM pg_amproc AS p1, pg_am AS p2
WHERE p1.amid = p2.oid AND p1.amprocnum > p2.amsupport;
-oid|oid|amname
----+---+------
+ oid | oid | amname
+-----+-----+--------
(0 rows)
-QUERY: SELECT p1.oid, p1.amname, p2.oid, p2.opcname
+-- Detect missing pg_amproc entries: should have as many support functions
+-- as AM expects for each opclass, unless there are none at all
+-- (some opclasses only offer support for a limited set of AMs...)
+SELECT p1.oid, p1.amname, p2.oid, p2.opcname
FROM pg_am AS p1, pg_opclass AS p2
WHERE p1.amsupport != (SELECT count(*) FROM pg_amproc AS p3
WHERE p3.amid = p1.oid AND p3.amopclaid = p2.oid)
AND EXISTS (SELECT * FROM pg_amproc AS p3
WHERE p3.amid = p1.oid AND p3.amopclaid = p2.oid);
-oid|amname|oid|opcname
----+------+---+-------
+ oid | amname | oid | opcname
+-----+--------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p2.oid, p2.proname, p3.oid, p4.oid, p4.proname
+-- Unfortunately, we can't check the amproc link very well because the
+-- signature of the function may be different for different support routines
+-- or different base data types.
+-- We can check that all the referenced instances of the same support
+-- routine number take the same number of parameters, but that's about it...
+SELECT p1.oid, p2.oid, p2.proname, p3.oid, p4.oid, p4.proname
FROM pg_amproc AS p1, pg_proc AS p2, pg_amproc AS p3, pg_proc AS p4
WHERE p1.oid != p3.oid AND
p1.amid = p3.amid AND p1.amprocnum = p3.amprocnum AND
p1.amproc = p2.oid AND p3.amproc = p4.oid AND
(p2.proretset OR p4.proretset OR p2.pronargs != p4.pronargs);
-oid|oid|proname|oid|oid|proname
----+---+-------+---+---+-------
+ oid | oid | proname | oid | oid | proname
+-----+-----+---------+-----+-----+---------
(0 rows)
-QUERY: CREATE TABLE PATH_TBL (f1 path);
-QUERY: INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)]');
-QUERY: INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
-QUERY: INSERT INTO PATH_TBL VALUES ('[(0,0),(3,0),(4,5),(1,6)]');
-QUERY: INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
-QUERY: INSERT INTO PATH_TBL VALUES ('1,2 ,3,4');
-QUERY: INSERT INTO PATH_TBL VALUES ('[1,2,3, 4]');
-QUERY: INSERT INTO PATH_TBL VALUES ('[11,12,13,14]');
-QUERY: INSERT INTO PATH_TBL VALUES ('(11,12,13,14)');
-QUERY: INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]');
+--
+-- PATH
+--
+--DROP TABLE PATH_TBL;
+CREATE TABLE PATH_TBL (f1 path);
+INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)]');
+INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
+INSERT INTO PATH_TBL VALUES ('[(0,0),(3,0),(4,5),(1,6)]');
+INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
+INSERT INTO PATH_TBL VALUES ('1,2 ,3,4');
+INSERT INTO PATH_TBL VALUES ('[1,2,3, 4]');
+INSERT INTO PATH_TBL VALUES ('[11,12,13,14]');
+INSERT INTO PATH_TBL VALUES ('(11,12,13,14)');
+-- bad values for parser testing
+INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]');
ERROR: Bad path external representation '[(,2),(3,4)]'
-QUERY: INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)');
+INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)');
ERROR: Bad path external representation '[(1,2),(3,4)'
-QUERY: SELECT f1 FROM PATH_TBL;
-f1
--------------------------
-[(1,2),(3,4)]
-((1,2),(3,4))
-[(0,0),(3,0),(4,5),(1,6)]
-((1,2),(3,4))
-((1,2),(3,4))
-[(1,2),(3,4)]
-[(11,12),(13,14)]
-((11,12),(13,14))
+SELECT f1 FROM PATH_TBL;
+ f1
+---------------------------
+ [(1,2),(3,4)]
+ ((1,2),(3,4))
+ [(0,0),(3,0),(4,5),(1,6)]
+ ((1,2),(3,4))
+ ((1,2),(3,4))
+ [(1,2),(3,4)]
+ [(11,12),(13,14)]
+ ((11,12),(13,14))
(8 rows)
-QUERY: SELECT '' AS count, f1 AS open_path FROM PATH_TBL WHERE isopen(f1);
-count|open_path
------+-------------------------
- |[(1,2),(3,4)]
- |[(0,0),(3,0),(4,5),(1,6)]
- |[(1,2),(3,4)]
- |[(11,12),(13,14)]
+SELECT '' AS count, f1 AS open_path FROM PATH_TBL WHERE isopen(f1);
+ count | open_path
+-------+---------------------------
+ | [(1,2),(3,4)]
+ | [(0,0),(3,0),(4,5),(1,6)]
+ | [(1,2),(3,4)]
+ | [(11,12),(13,14)]
(4 rows)
-QUERY: SELECT '' AS count, f1 AS closed_path FROM PATH_TBL WHERE isclosed(f1);
-count|closed_path
------+-----------------
- |((1,2),(3,4))
- |((1,2),(3,4))
- |((1,2),(3,4))
- |((11,12),(13,14))
+SELECT '' AS count, f1 AS closed_path FROM PATH_TBL WHERE isclosed(f1);
+ count | closed_path
+-------+-------------------
+ | ((1,2),(3,4))
+ | ((1,2),(3,4))
+ | ((1,2),(3,4))
+ | ((11,12),(13,14))
(4 rows)
-QUERY: SELECT '' AS count, pclose(f1) AS closed_path FROM PATH_TBL;
-count|closed_path
------+-------------------------
- |((1,2),(3,4))
- |((1,2),(3,4))
- |((0,0),(3,0),(4,5),(1,6))
- |((1,2),(3,4))
- |((1,2),(3,4))
- |((1,2),(3,4))
- |((11,12),(13,14))
- |((11,12),(13,14))
+SELECT '' AS count, pclose(f1) AS closed_path FROM PATH_TBL;
+ count | closed_path
+-------+---------------------------
+ | ((1,2),(3,4))
+ | ((1,2),(3,4))
+ | ((0,0),(3,0),(4,5),(1,6))
+ | ((1,2),(3,4))
+ | ((1,2),(3,4))
+ | ((1,2),(3,4))
+ | ((11,12),(13,14))
+ | ((11,12),(13,14))
(8 rows)
-QUERY: SELECT '' AS count, popen(f1) AS open_path FROM PATH_TBL;
-count|open_path
------+-------------------------
- |[(1,2),(3,4)]
- |[(1,2),(3,4)]
- |[(0,0),(3,0),(4,5),(1,6)]
- |[(1,2),(3,4)]
- |[(1,2),(3,4)]
- |[(1,2),(3,4)]
- |[(11,12),(13,14)]
- |[(11,12),(13,14)]
+SELECT '' AS count, popen(f1) AS open_path FROM PATH_TBL;
+ count | open_path
+-------+---------------------------
+ | [(1,2),(3,4)]
+ | [(1,2),(3,4)]
+ | [(0,0),(3,0),(4,5),(1,6)]
+ | [(1,2),(3,4)]
+ | [(1,2),(3,4)]
+ | [(1,2),(3,4)]
+ | [(11,12),(13,14)]
+ | [(11,12),(13,14)]
(8 rows)
-QUERY: CREATE TABLE POINT_TBL(f1 point);
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(0.0,0.0)');
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(-10.0,0.0)');
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(-3.0,4.0)');
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(5.1, 34.5)');
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(-5.0,-12.0)');
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('asdfasdf');
+--
+-- POINT
+--
+CREATE TABLE POINT_TBL(f1 point);
+INSERT INTO POINT_TBL(f1) VALUES ('(0.0,0.0)');
+INSERT INTO POINT_TBL(f1) VALUES ('(-10.0,0.0)');
+INSERT INTO POINT_TBL(f1) VALUES ('(-3.0,4.0)');
+INSERT INTO POINT_TBL(f1) VALUES ('(5.1, 34.5)');
+INSERT INTO POINT_TBL(f1) VALUES ('(-5.0,-12.0)');
+-- bad format points
+INSERT INTO POINT_TBL(f1) VALUES ('asdfasdf');
ERROR: Bad point external representation 'asdfasdf'
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('10.0,10.0');
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)');
+INSERT INTO POINT_TBL(f1) VALUES ('10.0,10.0');
+INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)');
ERROR: Bad point external representation '(10.0 10.0)'
-QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(10.0,10.0');
+INSERT INTO POINT_TBL(f1) VALUES ('(10.0,10.0');
ERROR: Bad point external representation '(10.0,10.0'
-QUERY: SELECT '' AS six, POINT_TBL.*;
-six|f1
----+----------
- |(0,0)
- |(-10,0)
- |(-3,4)
- |(5.1,34.5)
- |(-5,-12)
- |(10,10)
+SELECT '' AS six, POINT_TBL.*;
+ six | f1
+-----+------------
+ | (0,0)
+ | (-10,0)
+ | (-3,4)
+ | (5.1,34.5)
+ | (-5,-12)
+ | (10,10)
(6 rows)
-QUERY: SELECT '' AS three, p.* FROM POINT_TBL p WHERE p.f1 << '(0.0, 0.0)';
-three|f1
------+--------
- |(-10,0)
- |(-3,4)
- |(-5,-12)
+-- left of
+SELECT '' AS three, p.* FROM POINT_TBL p WHERE p.f1 << '(0.0, 0.0)';
+ three | f1
+-------+----------
+ | (-10,0)
+ | (-3,4)
+ | (-5,-12)
(3 rows)
-QUERY: SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >> p.f1;
-three|f1
------+--------
- |(-10,0)
- |(-3,4)
- |(-5,-12)
+-- right of
+SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >> p.f1;
+ three | f1
+-------+----------
+ | (-10,0)
+ | (-3,4)
+ | (-5,-12)
(3 rows)
-QUERY: SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >^ p.f1;
-one|f1
----+--------
- |(-5,-12)
+-- above
+SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >^ p.f1;
+ one | f1
+-----+----------
+ | (-5,-12)
(1 row)
-QUERY: SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 <^ '(0.0, 0.0)';
-one|f1
----+--------
- |(-5,-12)
+-- below
+SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 <^ '(0.0, 0.0)';
+ one | f1
+-----+----------
+ | (-5,-12)
(1 row)
-QUERY: SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 ~= '(5.1, 34.5)';
-one|f1
----+----------
- |(5.1,34.5)
+-- equal
+SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 ~= '(5.1, 34.5)';
+ one | f1
+-----+------------
+ | (5.1,34.5)
(1 row)
-QUERY: SELECT '' AS three, p.* FROM POINT_TBL p
- WHERE p.f1 @ '(0,0,100,100)'::box;
-three|f1
------+----------
- |(0,0)
- |(5.1,34.5)
- |(10,10)
+-- point in box
+SELECT '' AS three, p.* FROM POINT_TBL p
+ WHERE p.f1 @ box '(0,0,100,100)';
+ three | f1
+-------+------------
+ | (0,0)
+ | (5.1,34.5)
+ | (10,10)
(3 rows)
-QUERY: SELECT '' AS three, p.* FROM POINT_TBL p
- WHERE not p.f1 @ '(0,0,100,100)'::box;
-three|f1
------+--------
- |(-10,0)
- |(-3,4)
- |(-5,-12)
+SELECT '' AS three, p.* FROM POINT_TBL p
+ WHERE not p.f1 @ box '(0,0,100,100)';
+ three | f1
+-------+----------
+ | (-10,0)
+ | (-3,4)
+ | (-5,-12)
(3 rows)
-QUERY: SELECT '' AS two, p.* FROM POINT_TBL p
- WHERE p.f1 @ '[(0,0),(-10,0),(-10,10)]'::path;
-two|f1
----+-------
- |(0,0)
- |(-10,0)
+SELECT '' AS two, p.* FROM POINT_TBL p
+ WHERE p.f1 @ path '[(0,0),(-10,0),(-10,10)]';
+ two | f1
+-----+---------
+ | (0,0)
+ | (-10,0)
(2 rows)
-QUERY: SELECT '' AS six, p.f1, p.f1 <-> '(0,0)'::point AS dist
+SELECT '' AS six, p.f1, p.f1 <-> point '(0,0)' AS dist
FROM POINT_TBL p
ORDER BY dist;
-six|f1 | dist
----+----------+----------------
- |(0,0) | 0
- |(-3,4) | 5
- |(-10,0) | 10
- |(-5,-12) | 13
- |(10,10) | 14.142135623731
- |(5.1,34.5)|34.8749193547455
+ six | f1 | dist
+-----+------------+------------------
+ | (0,0) | 0
+ | (-3,4) | 5
+ | (-10,0) | 10
+ | (-5,-12) | 13
+ | (10,10) | 14.142135623731
+ | (5.1,34.5) | 34.8749193547455
(6 rows)
-QUERY: SET geqo TO 'off';
-QUERY: SELECT '' AS thirtysix, p1.f1 AS point1, p2.f1 AS point2, p1.f1 <-> p2.f1 AS dist
+SET geqo TO 'off';
+SELECT '' AS thirtysix, p1.f1 AS point1, p2.f1 AS point2, p1.f1 <-> p2.f1 AS dist
FROM POINT_TBL p1, POINT_TBL p2
ORDER BY dist, point1 using <<, point2 using <<;
-thirtysix|point1 |point2 | dist
----------+----------+----------+----------------
- |(-10,0) |(-10,0) | 0
- |(-5,-12) |(-5,-12) | 0
- |(-3,4) |(-3,4) | 0
- |(0,0) |(0,0) | 0
- |(5.1,34.5)|(5.1,34.5)| 0
- |(10,10) |(10,10) | 0
- |(-3,4) |(0,0) | 5
- |(0,0) |(-3,4) | 5
- |(-10,0) |(-3,4) |8.06225774829855
- |(-3,4) |(-10,0) |8.06225774829855
- |(-10,0) |(0,0) | 10
- |(0,0) |(-10,0) | 10
- |(-10,0) |(-5,-12) | 13
- |(-5,-12) |(-10,0) | 13
- |(-5,-12) |(0,0) | 13
- |(0,0) |(-5,-12) | 13
- |(0,0) |(10,10) | 14.142135623731
- |(10,10) |(0,0) | 14.142135623731
- |(-3,4) |(10,10) |14.3178210632764
- |(10,10) |(-3,4) |14.3178210632764
- |(-5,-12) |(-3,4) |16.1245154965971
- |(-3,4) |(-5,-12) |16.1245154965971
- |(-10,0) |(10,10) |22.3606797749979
- |(10,10) |(-10,0) |22.3606797749979
- |(5.1,34.5)|(10,10) |24.9851956166046
- |(10,10) |(5.1,34.5)|24.9851956166046
- |(-5,-12) |(10,10) |26.6270539113887
- |(10,10) |(-5,-12) |26.6270539113887
- |(-3,4) |(5.1,34.5)|31.5572495632937
- |(5.1,34.5)|(-3,4) |31.5572495632937
- |(0,0) |(5.1,34.5)|34.8749193547455
- |(5.1,34.5)|(0,0) |34.8749193547455
- |(-10,0) |(5.1,34.5)|37.6597928831267
- |(5.1,34.5)|(-10,0) |37.6597928831267
- |(-5,-12) |(5.1,34.5)|47.5842410888311
- |(5.1,34.5)|(-5,-12) |47.5842410888311
+ thirtysix | point1 | point2 | dist
+-----------+------------+------------+------------------
+ | (-10,0) | (-10,0) | 0
+ | (-5,-12) | (-5,-12) | 0
+ | (-3,4) | (-3,4) | 0
+ | (0,0) | (0,0) | 0
+ | (5.1,34.5) | (5.1,34.5) | 0
+ | (10,10) | (10,10) | 0
+ | (-3,4) | (0,0) | 5
+ | (0,0) | (-3,4) | 5
+ | (-10,0) | (-3,4) | 8.06225774829855
+ | (-3,4) | (-10,0) | 8.06225774829855
+ | (-10,0) | (0,0) | 10
+ | (0,0) | (-10,0) | 10
+ | (-10,0) | (-5,-12) | 13
+ | (-5,-12) | (-10,0) | 13
+ | (-5,-12) | (0,0) | 13
+ | (0,0) | (-5,-12) | 13
+ | (0,0) | (10,10) | 14.142135623731
+ | (10,10) | (0,0) | 14.142135623731
+ | (-3,4) | (10,10) | 14.3178210632764
+ | (10,10) | (-3,4) | 14.3178210632764
+ | (-5,-12) | (-3,4) | 16.1245154965971
+ | (-3,4) | (-5,-12) | 16.1245154965971
+ | (-10,0) | (10,10) | 22.3606797749979
+ | (10,10) | (-10,0) | 22.3606797749979
+ | (5.1,34.5) | (10,10) | 24.9851956166046
+ | (10,10) | (5.1,34.5) | 24.9851956166046
+ | (-5,-12) | (10,10) | 26.6270539113887
+ | (10,10) | (-5,-12) | 26.6270539113887
+ | (-3,4) | (5.1,34.5) | 31.5572495632937
+ | (5.1,34.5) | (-3,4) | 31.5572495632937
+ | (0,0) | (5.1,34.5) | 34.8749193547455
+ | (5.1,34.5) | (0,0) | 34.8749193547455
+ | (-10,0) | (5.1,34.5) | 37.6597928831267
+ | (5.1,34.5) | (-10,0) | 37.6597928831267
+ | (-5,-12) | (5.1,34.5) | 47.5842410888311
+ | (5.1,34.5) | (-5,-12) | 47.5842410888311
(36 rows)
-QUERY: SELECT '' AS thirty, p1.f1 AS point1, p2.f1 AS point2
+SELECT '' AS thirty, p1.f1 AS point1, p2.f1 AS point2
FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <-> p2.f1) > 3;
-thirty|point1 |point2
-------+----------+----------
- |(-10,0) |(0,0)
- |(-3,4) |(0,0)
- |(5.1,34.5)|(0,0)
- |(-5,-12) |(0,0)
- |(10,10) |(0,0)
- |(0,0) |(-10,0)
- |(-3,4) |(-10,0)
- |(5.1,34.5)|(-10,0)
- |(-5,-12) |(-10,0)
- |(10,10) |(-10,0)
- |(0,0) |(-3,4)
- |(-10,0) |(-3,4)
- |(5.1,34.5)|(-3,4)
- |(-5,-12) |(-3,4)
- |(10,10) |(-3,4)
- |(0,0) |(5.1,34.5)
- |(-10,0) |(5.1,34.5)
- |(-3,4) |(5.1,34.5)
- |(-5,-12) |(5.1,34.5)
- |(10,10) |(5.1,34.5)
- |(0,0) |(-5,-12)
- |(-10,0) |(-5,-12)
- |(-3,4) |(-5,-12)
- |(5.1,34.5)|(-5,-12)
- |(10,10) |(-5,-12)
- |(0,0) |(10,10)
- |(-10,0) |(10,10)
- |(-3,4) |(10,10)
- |(5.1,34.5)|(10,10)
- |(-5,-12) |(10,10)
+ thirty | point1 | point2
+--------+------------+------------
+ | (-10,0) | (0,0)
+ | (-3,4) | (0,0)
+ | (5.1,34.5) | (0,0)
+ | (-5,-12) | (0,0)
+ | (10,10) | (0,0)
+ | (0,0) | (-10,0)
+ | (-3,4) | (-10,0)
+ | (5.1,34.5) | (-10,0)
+ | (-5,-12) | (-10,0)
+ | (10,10) | (-10,0)
+ | (0,0) | (-3,4)
+ | (-10,0) | (-3,4)
+ | (5.1,34.5) | (-3,4)
+ | (-5,-12) | (-3,4)
+ | (10,10) | (-3,4)
+ | (0,0) | (5.1,34.5)
+ | (-10,0) | (5.1,34.5)
+ | (-3,4) | (5.1,34.5)
+ | (-5,-12) | (5.1,34.5)
+ | (10,10) | (5.1,34.5)
+ | (0,0) | (-5,-12)
+ | (-10,0) | (-5,-12)
+ | (-3,4) | (-5,-12)
+ | (5.1,34.5) | (-5,-12)
+ | (10,10) | (-5,-12)
+ | (0,0) | (10,10)
+ | (-10,0) | (10,10)
+ | (-3,4) | (10,10)
+ | (5.1,34.5) | (10,10)
+ | (-5,-12) | (10,10)
(30 rows)
-QUERY: SELECT '' AS fifteen, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance
+-- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10
+SELECT '' AS fifteen, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance
FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1
ORDER BY distance, point1 using <<, point2 using <<;
-fifteen|point1 |point2 | distance
--------+----------+----------+----------------
- |(-3,4) |(0,0) | 5
- |(-10,0) |(-3,4) |8.06225774829855
- |(-10,0) |(0,0) | 10
- |(-10,0) |(-5,-12) | 13
- |(-5,-12) |(0,0) | 13
- |(0,0) |(10,10) | 14.142135623731
- |(-3,4) |(10,10) |14.3178210632764
- |(-5,-12) |(-3,4) |16.1245154965971
- |(-10,0) |(10,10) |22.3606797749979
- |(5.1,34.5)|(10,10) |24.9851956166046
- |(-5,-12) |(10,10) |26.6270539113887
- |(-3,4) |(5.1,34.5)|31.5572495632937
- |(0,0) |(5.1,34.5)|34.8749193547455
- |(-10,0) |(5.1,34.5)|37.6597928831267
- |(-5,-12) |(5.1,34.5)|47.5842410888311
+ fifteen | point1 | point2 | distance
+---------+------------+------------+------------------
+ | (-3,4) | (0,0) | 5
+ | (-10,0) | (-3,4) | 8.06225774829855
+ | (-10,0) | (0,0) | 10
+ | (-10,0) | (-5,-12) | 13
+ | (-5,-12) | (0,0) | 13
+ | (0,0) | (10,10) | 14.142135623731
+ | (-3,4) | (10,10) | 14.3178210632764
+ | (-5,-12) | (-3,4) | 16.1245154965971
+ | (-10,0) | (10,10) | 22.3606797749979
+ | (5.1,34.5) | (10,10) | 24.9851956166046
+ | (-5,-12) | (10,10) | 26.6270539113887
+ | (-3,4) | (5.1,34.5) | 31.5572495632937
+ | (0,0) | (5.1,34.5) | 34.8749193547455
+ | (-10,0) | (5.1,34.5) | 37.6597928831267
+ | (-5,-12) | (5.1,34.5) | 47.5842410888311
(15 rows)
-QUERY: SELECT '' AS three, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance
- FROM POINT_TBL p1, POINT_TBL p2
+-- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10
+SELECT '' AS three, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance
+ FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 and p1.f1 >^ p2.f1
ORDER BY distance;
-three|point1 |point2 | distance
------+----------+--------+----------------
- |(-3,4) |(0,0) | 5
- |(-10,0) |(-5,-12)| 13
- |(5.1,34.5)|(10,10) |24.9851956166046
+ three | point1 | point2 | distance
+-------+------------+----------+------------------
+ | (-3,4) | (0,0) | 5
+ | (-10,0) | (-5,-12) | 13
+ | (5.1,34.5) | (10,10) | 24.9851956166046
(3 rows)
-QUERY: RESET geqo;
+RESET geqo;
-QUERY: CREATE TABLE POLYGON_TBL(f1 polygon);
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(2.0,0.0),(2.0,4.0),(0.0,0.0)');
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(3.0,1.0),(3.0,3.0),(1.0,0.0)');
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,0.0)');
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,1.0),(0.0,1.0)');
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('0.0');
+--
+-- POLYGON
+--
+-- polygon logic
+--
+-- 3 o
+-- |
+-- 2 + |
+-- / |
+-- 1 # o +
+-- / |
+-- 0 #-----o-+
+--
+-- 0 1 2 3 4
+--
+CREATE TABLE POLYGON_TBL(f1 polygon);
+INSERT INTO POLYGON_TBL(f1) VALUES ('(2.0,0.0),(2.0,4.0),(0.0,0.0)');
+INSERT INTO POLYGON_TBL(f1) VALUES ('(3.0,1.0),(3.0,3.0),(1.0,0.0)');
+-- degenerate polygons
+INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,0.0)');
+INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,1.0),(0.0,1.0)');
+-- bad polygon input strings
+INSERT INTO POLYGON_TBL(f1) VALUES ('0.0');
ERROR: Bad polygon external representation '0.0'
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0 0.0');
+INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0 0.0');
ERROR: Bad polygon external representation '(0.0 0.0'
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2)');
+INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2)');
ERROR: Bad polygon external representation '(0,1,2)'
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2,3');
+INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2,3');
ERROR: Bad polygon external representation '(0,1,2,3'
-QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('asdf');
+INSERT INTO POLYGON_TBL(f1) VALUES ('asdf');
ERROR: Bad polygon external representation 'asdf'
-QUERY: SELECT '' AS four, POLYGON_TBL.*;
-four|f1
-----+-------------------
- |((2,0),(2,4),(0,0))
- |((3,1),(3,3),(1,0))
- |((0,0))
- |((0,1),(0,1))
+SELECT '' AS four, POLYGON_TBL.*;
+ four | f1
+------+---------------------
+ | ((2,0),(2,4),(0,0))
+ | ((3,1),(3,3),(1,0))
+ | ((0,0))
+ | ((0,1),(0,1))
(4 rows)
-QUERY: SELECT '' AS three, p.*
+-- overlap
+SELECT '' AS three, p.*
FROM POLYGON_TBL p
WHERE p.f1 && '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
-three|f1
------+-------------------
- |((2,0),(2,4),(0,0))
- |((3,1),(3,3),(1,0))
+ three | f1
+-------+---------------------
+ | ((2,0),(2,4),(0,0))
+ | ((3,1),(3,3),(1,0))
(2 rows)
-QUERY: SELECT '' AS four, p.*
+-- left overlap
+SELECT '' AS four, p.*
FROM POLYGON_TBL p
WHERE p.f1 &< '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
-four|f1
-----+-------------------
- |((2,0),(2,4),(0,0))
- |((3,1),(3,3),(1,0))
- |((0,0))
- |((0,1),(0,1))
+ four | f1
+------+---------------------
+ | ((2,0),(2,4),(0,0))
+ | ((3,1),(3,3),(1,0))
+ | ((0,0))
+ | ((0,1),(0,1))
(4 rows)
-QUERY: SELECT '' AS two, p.*
+-- right overlap
+SELECT '' AS two, p.*
FROM POLYGON_TBL p
WHERE p.f1 &> '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
-two|f1
----+-------------------
- |((2,0),(2,4),(0,0))
- |((3,1),(3,3),(1,0))
+ two | f1
+-----+---------------------
+ | ((2,0),(2,4),(0,0))
+ | ((3,1),(3,3),(1,0))
(2 rows)
-QUERY: SELECT '' AS one, p.*
+-- left of
+SELECT '' AS one, p.*
FROM POLYGON_TBL p
WHERE p.f1 << '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
-one|f1
----+-------------
- |((0,0))
- |((0,1),(0,1))
+ one | f1
+-----+---------------
+ | ((0,0))
+ | ((0,1),(0,1))
(2 rows)
-QUERY: SELECT '' AS zero, p.*
+-- right of
+SELECT '' AS zero, p.*
FROM POLYGON_TBL p
WHERE p.f1 >> '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
-zero|f1
-----+--
+ zero | f1
+------+----
(0 rows)
-QUERY: SELECT '' AS one, p.*
+-- contained
+SELECT '' AS one, p.*
FROM POLYGON_TBL p
- WHERE p.f1 @ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon;
-one|f1
----+-------------------
- |((3,1),(3,3),(1,0))
+ WHERE p.f1 @ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
+ one | f1
+-----+---------------------
+ | ((3,1),(3,3),(1,0))
(1 row)
-QUERY: SELECT '' AS one, p.*
+-- same
+SELECT '' AS one, p.*
FROM POLYGON_TBL p
- WHERE p.f1 ~= '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon;
-one|f1
----+-------------------
- |((3,1),(3,3),(1,0))
+ WHERE p.f1 ~= polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
+ one | f1
+-----+---------------------
+ | ((3,1),(3,3),(1,0))
(1 row)
-QUERY: SELECT '' AS one, p.*
+-- contains
+SELECT '' AS one, p.*
FROM POLYGON_TBL p
- WHERE p.f1 ~ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon;
-one|f1
----+-------------------
- |((3,1),(3,3),(1,0))
+ WHERE p.f1 ~ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
+ one | f1
+-----+---------------------
+ | ((3,1),(3,3),(1,0))
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon << '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
-false
------
-f
+--
+-- polygon logic
+--
+-- 3 o
+-- |
+-- 2 + |
+-- / |
+-- 1 / o +
+-- / |
+-- 0 +-----o-+
+--
+-- 0 1 2 3 4
+--
+-- left of
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' << polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+ false
+-------
+ f
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon << '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS true;
-true
-----
-f
+-- left overlap
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' << polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS true;
+ true
+------
+ f
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon &> '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS true;
-true
-----
-t
+-- right overlap
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' &> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS true;
+ true
+------
+ t
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon >> '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
-false
------
-f
+-- right of
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' >> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+ false
+-------
+ f
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon @ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
-false
------
-f
+-- contained in
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' @ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+ false
+-------
+ f
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon ~ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
-false
------
-f
+-- contains
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' ~ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+ false
+-------
+ f
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon ~= '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
-false
------
-f
+-- same
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' ~= polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+ false
+-------
+ f
(1 row)
-QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon && '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS true;
-true
-----
-t
+-- overlap
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' && polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS true;
+ true
+------
+ t
(1 row)
-QUERY: CREATE TABLE RELTIME_TBL (f1 reltime);
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 1 minute');
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 5 hour');
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 10 day');
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 34 year');
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 3 months');
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 14 seconds ago');
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('badly formatted reltime');
+--
+-- RELTIME
+--
+CREATE TABLE RELTIME_TBL (f1 reltime);
+INSERT INTO RELTIME_TBL (f1) VALUES ('@ 1 minute');
+INSERT INTO RELTIME_TBL (f1) VALUES ('@ 5 hour');
+INSERT INTO RELTIME_TBL (f1) VALUES ('@ 10 day');
+INSERT INTO RELTIME_TBL (f1) VALUES ('@ 34 year');
+INSERT INTO RELTIME_TBL (f1) VALUES ('@ 3 months');
+INSERT INTO RELTIME_TBL (f1) VALUES ('@ 14 seconds ago');
+-- badly formatted reltimes
+INSERT INTO RELTIME_TBL (f1) VALUES ('badly formatted reltime');
ERROR: Bad reltime external representation 'badly formatted reltime'
-QUERY: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 30 eons ago');
+INSERT INTO RELTIME_TBL (f1) VALUES ('@ 30 eons ago');
ERROR: Bad reltime external representation '@ 30 eons ago'
-QUERY: SELECT '' AS six, RELTIME_TBL.*;
-six|f1
----+-------------
- |@ 1 min
- |@ 5 hours
- |@ 10 days
- |@ 34 years
- |@ 3 mons
- |@ 14 secs ago
+-- test reltime operators
+SELECT '' AS six, RELTIME_TBL.*;
+ six | f1
+-----+---------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 10 days
+ | @ 34 years
+ | @ 3 mons
+ | @ 14 secs ago
(6 rows)
-QUERY: SELECT '' AS five, RELTIME_TBL.*
- WHERE RELTIME_TBL.f1 <> '@ 10 days'::reltime;
-five|f1
-----+-------------
- |@ 1 min
- |@ 5 hours
- |@ 34 years
- |@ 3 mons
- |@ 14 secs ago
+SELECT '' AS five, RELTIME_TBL.*
+ WHERE RELTIME_TBL.f1 <> reltime '@ 10 days';
+ five | f1
+------+---------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 34 years
+ | @ 3 mons
+ | @ 14 secs ago
(5 rows)
-QUERY: SELECT '' AS three, RELTIME_TBL.*
- WHERE RELTIME_TBL.f1 <= '@ 5 hours'::reltime;
-three|f1
------+-------------
- |@ 1 min
- |@ 5 hours
- |@ 14 secs ago
+SELECT '' AS three, RELTIME_TBL.*
+ WHERE RELTIME_TBL.f1 <= reltime '@ 5 hours';
+ three | f1
+-------+---------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 14 secs ago
(3 rows)
-QUERY: SELECT '' AS three, RELTIME_TBL.*
- WHERE RELTIME_TBL.f1 < '@ 1 day'::reltime;
-three|f1
------+-------------
- |@ 1 min
- |@ 5 hours
- |@ 14 secs ago
+SELECT '' AS three, RELTIME_TBL.*
+ WHERE RELTIME_TBL.f1 < reltime '@ 1 day';
+ three | f1
+-------+---------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 14 secs ago
(3 rows)
-QUERY: SELECT '' AS one, RELTIME_TBL.*
- WHERE RELTIME_TBL.f1 = '@ 34 years'::reltime;
-one|f1
----+----------
- |@ 34 years
+SELECT '' AS one, RELTIME_TBL.*
+ WHERE RELTIME_TBL.f1 = reltime '@ 34 years';
+ one | f1
+-----+------------
+ | @ 34 years
(1 row)
-QUERY: SELECT '' AS two, RELTIME_TBL.*
- WHERE RELTIME_TBL.f1 >= '@ 1 month'::reltime;
-two|f1
----+----------
- |@ 34 years
- |@ 3 mons
+SELECT '' AS two, RELTIME_TBL.*
+ WHERE RELTIME_TBL.f1 >= reltime '@ 1 month';
+ two | f1
+-----+------------
+ | @ 34 years
+ | @ 3 mons
(2 rows)
-QUERY: SELECT '' AS five, RELTIME_TBL.*
- WHERE RELTIME_TBL.f1 > '@ 3 seconds ago'::reltime;
-five|f1
-----+----------
- |@ 1 min
- |@ 5 hours
- |@ 10 days
- |@ 34 years
- |@ 3 mons
+SELECT '' AS five, RELTIME_TBL.*
+ WHERE RELTIME_TBL.f1 > reltime '@ 3 seconds ago';
+ five | f1
+------+------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 10 days
+ | @ 34 years
+ | @ 3 mons
(5 rows)
-QUERY: SELECT '' AS fifteen, r1.*, r2.*
+SELECT '' AS fifteen, r1.*, r2.*
FROM RELTIME_TBL r1, RELTIME_TBL r2
WHERE r1.f1 > r2.f1
ORDER BY r1.f1, r2.f1;
-fifteen|f1 |f1
--------+----------+-------------
- |@ 1 min |@ 14 secs ago
- |@ 5 hours |@ 14 secs ago
- |@ 5 hours |@ 1 min
- |@ 10 days |@ 14 secs ago
- |@ 10 days |@ 1 min
- |@ 10 days |@ 5 hours
- |@ 3 mons |@ 14 secs ago
- |@ 3 mons |@ 1 min
- |@ 3 mons |@ 5 hours
- |@ 3 mons |@ 10 days
- |@ 34 years|@ 14 secs ago
- |@ 34 years|@ 1 min
- |@ 34 years|@ 5 hours
- |@ 34 years|@ 10 days
- |@ 34 years|@ 3 mons
+ fifteen | f1 | f1
+---------+------------+---------------
+ | @ 1 min | @ 14 secs ago
+ | @ 5 hours | @ 14 secs ago
+ | @ 5 hours | @ 1 min
+ | @ 10 days | @ 14 secs ago
+ | @ 10 days | @ 1 min
+ | @ 10 days | @ 5 hours
+ | @ 3 mons | @ 14 secs ago
+ | @ 3 mons | @ 1 min
+ | @ 3 mons | @ 5 hours
+ | @ 3 mons | @ 10 days
+ | @ 34 years | @ 14 secs ago
+ | @ 34 years | @ 1 min
+ | @ 34 years | @ 5 hours
+ | @ 34 years | @ 10 days
+ | @ 34 years | @ 3 mons
(15 rows)
-QUERY: SELECT 'first line'
+--
+-- STRINGS
+-- Test various data entry syntaxes.
+--
+-- SQL92 string continuation syntax
+SELECT 'first line'
' - next line'
' - third line'
AS "Three lines to one";
-Three lines to one
------------------------------------
-first line - next line - third line
+ Three lines to one
+-------------------------------------
+ first line - next line - third line
(1 row)
-QUERY: SELECT 'first line'
+-- illegal string continuation syntax
+SELECT 'first line'
' - next line' /* this comment is not allowed here */
' - third line'
AS "Illegal comment within continuation";
ERROR: parser: parse error at or near "'"
-QUERY: SELECT CAST(f1 AS text) AS "text(char)" FROM CHAR_TBL;
-text(char)
-----------
-a
-ab
-abcd
-abcd
+--
+-- test conversions between various string types
+--
+SELECT CAST(f1 AS text) AS "text(char)" FROM CHAR_TBL;
+ text(char)
+------------
+ a
+ ab
+ abcd
+ abcd
(4 rows)
-QUERY: SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL;
-text(varchar)
--------------
-a
-ab
-abcd
-abcd
+SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL;
+ text(varchar)
+---------------
+ a
+ ab
+ abcd
+ abcd
(4 rows)
-QUERY: SELECT CAST(name 'namefield' AS text) AS "text(name)";
-text(name)
-----------
-namefield
+SELECT CAST(name 'namefield' AS text) AS "text(name)";
+ text(name)
+------------
+ namefield
(1 row)
-QUERY: SELECT CAST(f1 AS char) AS "char(text)" FROM TEXT_TBL;
-char(text)
------------------
-doh!
-hi de ho neighbor
+SELECT CAST(f1 AS char) AS "char(text)" FROM TEXT_TBL;
+ char(text)
+-------------------
+ doh!
+ hi de ho neighbor
(2 rows)
-QUERY: SELECT CAST(f1 AS char) AS "char(varchar)" FROM VARCHAR_TBL;
-char(varchar)
--------------
-a
-ab
-abcd
-abcd
+SELECT CAST(f1 AS char) AS "char(varchar)" FROM VARCHAR_TBL;
+ char(varchar)
+---------------
+ a
+ ab
+ abcd
+ abcd
(4 rows)
-QUERY: SELECT CAST(name 'namefield' AS char) AS "char(name)";
-char(name)
-----------
-namefield
+SELECT CAST(name 'namefield' AS char) AS "char(name)";
+ char(name)
+------------
+ namefield
(1 row)
-QUERY: SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
-varchar(text)
------------------
-doh!
-hi de ho neighbor
+SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
+ varchar(text)
+-------------------
+ doh!
+ hi de ho neighbor
(2 rows)
-QUERY: SELECT CAST(f1 AS varchar) AS "varchar(char)" FROM CHAR_TBL;
-varchar(char)
--------------
-a
-ab
-abcd
-abcd
+SELECT CAST(f1 AS varchar) AS "varchar(char)" FROM CHAR_TBL;
+ varchar(char)
+---------------
+ a
+ ab
+ abcd
+ abcd
(4 rows)
-QUERY: SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
-varchar(name)
--------------
-namefield
+SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
+ varchar(name)
+---------------
+ namefield
(1 row)
-QUERY: SELECT TRIM(BOTH FROM ' bunch o blanks ') AS "bunch o blanks";
-bunch o blanks
---------------
-bunch o blanks
+--
+-- test SQL92 string functions
+--
+SELECT TRIM(BOTH FROM ' bunch o blanks ') AS "bunch o blanks";
+ bunch o blanks
+----------------
+ bunch o blanks
(1 row)
-QUERY: SELECT TRIM(LEADING FROM ' bunch o blanks ') AS "bunch o blanks ";
-bunch o blanks
-----------------
-bunch o blanks
+SELECT TRIM(LEADING FROM ' bunch o blanks ') AS "bunch o blanks ";
+ bunch o blanks
+------------------
+ bunch o blanks
(1 row)
-QUERY: SELECT TRIM(TRAILING FROM ' bunch o blanks ') AS " bunch o blanks";
- bunch o blanks
-----------------
- bunch o blanks
+SELECT TRIM(TRAILING FROM ' bunch o blanks ') AS " bunch o blanks";
+ bunch o blanks
+------------------
+ bunch o blanks
(1 row)
-QUERY: SELECT TRIM(BOTH 'x' FROM 'xxxxxsome Xsxxxxx') AS "some Xs";
-some Xs
--------
-some Xs
+SELECT TRIM(BOTH 'x' FROM 'xxxxxsome Xsxxxxx') AS "some Xs";
+ some Xs
+---------
+ some Xs
(1 row)
-QUERY: SELECT SUBSTRING('1234567890' FROM 3) AS "34567890";
-34567890
---------
-34567890
+SELECT SUBSTRING('1234567890' FROM 3) AS "34567890";
+ 34567890
+----------
+ 34567890
(1 row)
-QUERY: SELECT SUBSTRING('1234567890' FROM 4 FOR 3) AS "456";
-456
----
-456
+SELECT SUBSTRING('1234567890' FROM 4 FOR 3) AS "456";
+ 456
+-----
+ 456
(1 row)
-QUERY: SELECT POSITION('4' IN '1234567890') AS "4";
-4
--
-4
+SELECT POSITION('4' IN '1234567890') AS "4";
+ 4
+---
+ 4
(1 row)
-QUERY: SELECT POSITION(5 IN '1234567890') AS "5";
-5
--
-5
+SELECT POSITION(5 IN '1234567890') AS "5";
+ 5
+---
+ 5
(1 row)
-QUERY: SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
-Concat unknown types
---------------------
-unknown and unknown
+--
+-- test implicit type conversion
+--
+SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
+ Concat unknown types
+----------------------
+ unknown and unknown
(1 row)
-QUERY: SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
-Concat text to unknown type
----------------------------
-text and unknown
+SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
+ Concat text to unknown type
+-----------------------------
+ text and unknown
(1 row)
-QUERY: SELECT text 'text' || char ' and char' AS "Concat text to char";
-Concat text to char
--------------------
-text and char
+SELECT text 'text' || char ' and char' AS "Concat text to char";
+ Concat text to char
+---------------------
+ text and char
(1 row)
-QUERY: SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
-Concat text to varchar
-----------------------
-text and varchar
+SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
+ Concat text to varchar
+------------------------
+ text and varchar
(1 row)
-QUERY: CREATE TABLE TIMESPAN_TBL (f1 timespan);
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 1 minute');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 5 hour');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 10 day');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 34 year');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 3 months');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 14 seconds ago');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('6 years');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('5 months');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('5 months 12 hours');
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('badly formatted timespan');
+--
+-- TIMESPAN
+--
+CREATE TABLE TIMESPAN_TBL (f1 timespan);
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 1 minute');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 5 hour');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 10 day');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 34 year');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 3 months');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 14 seconds ago');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('6 years');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('5 months');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('5 months 12 hours');
+-- badly formatted timespan
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('badly formatted timespan');
ERROR: Bad timespan external representation 'badly formatted timespan'
-QUERY: INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 30 eons ago');
+INSERT INTO TIMESPAN_TBL (f1) VALUES ('@ 30 eons ago');
ERROR: Bad timespan external representation '@ 30 eons ago'
-QUERY: SELECT '' AS ten, TIMESPAN_TBL.*;
-ten|f1
----+-----------------------------
- |@ 1 min
- |@ 5 hours
- |@ 10 days
- |@ 34 years
- |@ 3 mons
- |@ 14 secs ago
- |@ 1 day 2 hours 3 mins 4 secs
- |@ 6 years
- |@ 5 mons
- |@ 5 mons 12 hours
+-- test timespan operators
+SELECT '' AS ten, TIMESPAN_TBL.*;
+ ten | f1
+-----+-------------------------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 10 days
+ | @ 34 years
+ | @ 3 mons
+ | @ 14 secs ago
+ | @ 1 day 2 hours 3 mins 4 secs
+ | @ 6 years
+ | @ 5 mons
+ | @ 5 mons 12 hours
(10 rows)
-QUERY: SELECT '' AS nine, TIMESPAN_TBL.*
- WHERE TIMESPAN_TBL.f1 <> '@ 10 days'::timespan;
-nine|f1
-----+-----------------------------
- |@ 1 min
- |@ 5 hours
- |@ 34 years
- |@ 3 mons
- |@ 14 secs ago
- |@ 1 day 2 hours 3 mins 4 secs
- |@ 6 years
- |@ 5 mons
- |@ 5 mons 12 hours
+SELECT '' AS nine, TIMESPAN_TBL.*
+ WHERE TIMESPAN_TBL.f1 <> timespan '@ 10 days';
+ nine | f1
+------+-------------------------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 34 years
+ | @ 3 mons
+ | @ 14 secs ago
+ | @ 1 day 2 hours 3 mins 4 secs
+ | @ 6 years
+ | @ 5 mons
+ | @ 5 mons 12 hours
(9 rows)
-QUERY: SELECT '' AS three, TIMESPAN_TBL.*
- WHERE TIMESPAN_TBL.f1 <= '@ 5 hours'::timespan;
-three|f1
------+-------------
- |@ 1 min
- |@ 5 hours
- |@ 14 secs ago
+SELECT '' AS three, TIMESPAN_TBL.*
+ WHERE TIMESPAN_TBL.f1 <= timespan '@ 5 hours';
+ three | f1
+-------+---------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 14 secs ago
(3 rows)
-QUERY: SELECT '' AS three, TIMESPAN_TBL.*
- WHERE TIMESPAN_TBL.f1 < '@ 1 day'::timespan;
-three|f1
------+-------------
- |@ 1 min
- |@ 5 hours
- |@ 14 secs ago
+SELECT '' AS three, TIMESPAN_TBL.*
+ WHERE TIMESPAN_TBL.f1 < timespan '@ 1 day';
+ three | f1
+-------+---------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 14 secs ago
(3 rows)
-QUERY: SELECT '' AS one, TIMESPAN_TBL.*
- WHERE TIMESPAN_TBL.f1 = '@ 34 years'::timespan;
-one|f1
----+----------
- |@ 34 years
+SELECT '' AS one, TIMESPAN_TBL.*
+ WHERE TIMESPAN_TBL.f1 = timespan '@ 34 years';
+ one | f1
+-----+------------
+ | @ 34 years
(1 row)
-QUERY: SELECT '' AS five, TIMESPAN_TBL.*
- WHERE TIMESPAN_TBL.f1 >= '@ 1 month'::timespan;
-five|f1
-----+-----------------
- |@ 34 years
- |@ 3 mons
- |@ 6 years
- |@ 5 mons
- |@ 5 mons 12 hours
+SELECT '' AS five, TIMESPAN_TBL.*
+ WHERE TIMESPAN_TBL.f1 >= timespan '@ 1 month';
+ five | f1
+------+-------------------
+ | @ 34 years
+ | @ 3 mons
+ | @ 6 years
+ | @ 5 mons
+ | @ 5 mons 12 hours
(5 rows)
-QUERY: SELECT '' AS nine, TIMESPAN_TBL.*
- WHERE TIMESPAN_TBL.f1 > '@ 3 seconds ago'::timespan;
-nine|f1
-----+-----------------------------
- |@ 1 min
- |@ 5 hours
- |@ 10 days
- |@ 34 years
- |@ 3 mons
- |@ 1 day 2 hours 3 mins 4 secs
- |@ 6 years
- |@ 5 mons
- |@ 5 mons 12 hours
+SELECT '' AS nine, TIMESPAN_TBL.*
+ WHERE TIMESPAN_TBL.f1 > timespan '@ 3 seconds ago';
+ nine | f1
+------+-------------------------------
+ | @ 1 min
+ | @ 5 hours
+ | @ 10 days
+ | @ 34 years
+ | @ 3 mons
+ | @ 1 day 2 hours 3 mins 4 secs
+ | @ 6 years
+ | @ 5 mons
+ | @ 5 mons 12 hours
(9 rows)
-QUERY: SELECT '' AS fortyfive, r1.*, r2.*
+SELECT '' AS fortyfive, r1.*, r2.*
FROM TIMESPAN_TBL r1, TIMESPAN_TBL r2
WHERE r1.f1 > r2.f1
ORDER BY r1.f1, r2.f1;
-fortyfive|f1 |f1
----------+-----------------------------+-----------------------------
- |@ 1 min |@ 14 secs ago
- |@ 5 hours |@ 14 secs ago
- |@ 5 hours |@ 1 min
- |@ 1 day 2 hours 3 mins 4 secs|@ 14 secs ago
- |@ 1 day 2 hours 3 mins 4 secs|@ 1 min
- |@ 1 day 2 hours 3 mins 4 secs|@ 5 hours
- |@ 10 days |@ 14 secs ago
- |@ 10 days |@ 1 min
- |@ 10 days |@ 5 hours
- |@ 10 days |@ 1 day 2 hours 3 mins 4 secs
- |@ 3 mons |@ 14 secs ago
- |@ 3 mons |@ 1 min
- |@ 3 mons |@ 5 hours
- |@ 3 mons |@ 1 day 2 hours 3 mins 4 secs
- |@ 3 mons |@ 10 days
- |@ 5 mons |@ 14 secs ago
- |@ 5 mons |@ 1 min
- |@ 5 mons |@ 5 hours
- |@ 5 mons |@ 1 day 2 hours 3 mins 4 secs
- |@ 5 mons |@ 10 days
- |@ 5 mons |@ 3 mons
- |@ 5 mons 12 hours |@ 14 secs ago
- |@ 5 mons 12 hours |@ 1 min
- |@ 5 mons 12 hours |@ 5 hours
- |@ 5 mons 12 hours |@ 1 day 2 hours 3 mins 4 secs
- |@ 5 mons 12 hours |@ 10 days
- |@ 5 mons 12 hours |@ 3 mons
- |@ 5 mons 12 hours |@ 5 mons
- |@ 6 years |@ 14 secs ago
- |@ 6 years |@ 1 min
- |@ 6 years |@ 5 hours
- |@ 6 years |@ 1 day 2 hours 3 mins 4 secs
- |@ 6 years |@ 10 days
- |@ 6 years |@ 3 mons
- |@ 6 years |@ 5 mons
- |@ 6 years |@ 5 mons 12 hours
- |@ 34 years |@ 14 secs ago
- |@ 34 years |@ 1 min
- |@ 34 years |@ 5 hours
- |@ 34 years |@ 1 day 2 hours 3 mins 4 secs
- |@ 34 years |@ 10 days
- |@ 34 years |@ 3 mons
- |@ 34 years |@ 5 mons
- |@ 34 years |@ 5 mons 12 hours
- |@ 34 years |@ 6 years
+ fortyfive | f1 | f1
+-----------+-------------------------------+-------------------------------
+ | @ 1 min | @ 14 secs ago
+ | @ 5 hours | @ 14 secs ago
+ | @ 5 hours | @ 1 min
+ | @ 1 day 2 hours 3 mins 4 secs | @ 14 secs ago
+ | @ 1 day 2 hours 3 mins 4 secs | @ 1 min
+ | @ 1 day 2 hours 3 mins 4 secs | @ 5 hours
+ | @ 10 days | @ 14 secs ago
+ | @ 10 days | @ 1 min
+ | @ 10 days | @ 5 hours
+ | @ 10 days | @ 1 day 2 hours 3 mins 4 secs
+ | @ 3 mons | @ 14 secs ago
+ | @ 3 mons | @ 1 min
+ | @ 3 mons | @ 5 hours
+ | @ 3 mons | @ 1 day 2 hours 3 mins 4 secs
+ | @ 3 mons | @ 10 days
+ | @ 5 mons | @ 14 secs ago
+ | @ 5 mons | @ 1 min
+ | @ 5 mons | @ 5 hours
+ | @ 5 mons | @ 1 day 2 hours 3 mins 4 secs
+ | @ 5 mons | @ 10 days
+ | @ 5 mons | @ 3 mons
+ | @ 5 mons 12 hours | @ 14 secs ago
+ | @ 5 mons 12 hours | @ 1 min
+ | @ 5 mons 12 hours | @ 5 hours
+ | @ 5 mons 12 hours | @ 1 day 2 hours 3 mins 4 secs
+ | @ 5 mons 12 hours | @ 10 days
+ | @ 5 mons 12 hours | @ 3 mons
+ | @ 5 mons 12 hours | @ 5 mons
+ | @ 6 years | @ 14 secs ago
+ | @ 6 years | @ 1 min
+ | @ 6 years | @ 5 hours
+ | @ 6 years | @ 1 day 2 hours 3 mins 4 secs
+ | @ 6 years | @ 10 days
+ | @ 6 years | @ 3 mons
+ | @ 6 years | @ 5 mons
+ | @ 6 years | @ 5 mons 12 hours
+ | @ 34 years | @ 14 secs ago
+ | @ 34 years | @ 1 min
+ | @ 34 years | @ 5 hours
+ | @ 34 years | @ 1 day 2 hours 3 mins 4 secs
+ | @ 34 years | @ 10 days
+ | @ 34 years | @ 3 mons
+ | @ 34 years | @ 5 mons
+ | @ 34 years | @ 5 mons 12 hours
+ | @ 34 years | @ 6 years
(45 rows)
-QUERY: CREATE TABLE TINTERVAL_TBL (f1 tinterval);
-QUERY: INSERT INTO TINTERVAL_TBL (f1)
+--
+-- TINTERVAL
+--
+CREATE TABLE TINTERVAL_TBL (f1 tinterval);
+INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["-infinity" "infinity"]');
-QUERY: INSERT INTO TINTERVAL_TBL (f1)
+INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]');
-QUERY: INSERT INTO TINTERVAL_TBL (f1)
+INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]');
-QUERY: INSERT INTO TINTERVAL_TBL (f1)
+INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["epoch" "Mon May 1 00:30:30 1995"]');
-QUERY: INSERT INTO TINTERVAL_TBL (f1)
+INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["Feb 15 1990 12:15:03" "current"]');
-QUERY: INSERT INTO TINTERVAL_TBL (f1)
+-- badly formatted tintervals
+INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["bad time specifications" ""]');
ERROR: Bad abstime external representation 'bad time specifications'
-QUERY: INSERT INTO TINTERVAL_TBL (f1)
+INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["" "infinity"]');
ERROR: Bad abstime external representation ''
-QUERY: SELECT '' AS five, TINTERVAL_TBL.*;
-five|f1
-----+---------------------------------------------------------------
- |["-infinity" "infinity"]
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"]
+-- test tinterval operators
+SELECT '' AS five, TINTERVAL_TBL.*;
+ five | f1
+------+-----------------------------------------------------------------
+ | ["-infinity" "infinity"]
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"]
(5 rows)
-QUERY: SELECT '' AS one, t.*
+-- length ==
+SELECT '' AS one, t.*
FROM TINTERVAL_TBL t
WHERE t.f1 #= '@ 1 months';
-one|f1
----+---------------------------------------------------------------
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ one | f1
+-----+-----------------------------------------------------------------
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
(1 row)
-QUERY: SELECT '' AS three, t.*
+-- length <>
+SELECT '' AS three, t.*
FROM TINTERVAL_TBL t
WHERE t.f1 #<> '@ 1 months';
-three|f1
------+---------------------------------------------------------------
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"]
+ three | f1
+-------+-----------------------------------------------------------------
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"]
(3 rows)
-QUERY: SELECT '' AS zero, t.*
+-- length <
+SELECT '' AS zero, t.*
FROM TINTERVAL_TBL t
WHERE t.f1 #< '@ 1 month';
-zero|f1
-----+--
+ zero | f1
+------+----
(0 rows)
-QUERY: SELECT '' AS one, t.*
+-- length <=
+SELECT '' AS one, t.*
FROM TINTERVAL_TBL t
WHERE t.f1 #<= '@ 1 month';
-one|f1
----+---------------------------------------------------------------
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ one | f1
+-----+-----------------------------------------------------------------
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
(1 row)
-QUERY: SELECT '' AS three, t.*
+-- length >
+SELECT '' AS three, t.*
FROM TINTERVAL_TBL t
WHERE t.f1 #> '@ 1 year';
-three|f1
------+---------------------------------------------------------------
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"]
+ three | f1
+-------+-----------------------------------------------------------------
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"]
(3 rows)
-QUERY: SELECT '' AS three, t.*
+-- length >=
+SELECT '' AS three, t.*
FROM TINTERVAL_TBL t
WHERE t.f1 #>= '@ 3 years';
-three|f1
------+---------------------------------------------------------------
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"]
+ three | f1
+-------+-----------------------------------------------------------------
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"]
(3 rows)
-QUERY: SELECT '' AS three, t1.*
+-- overlaps
+SELECT '' AS three, t1.*
FROM TINTERVAL_TBL t1
WHERE t1.f1 &&
- '["Aug 15 14:23:19 1983" "Sep 16 14:23:19 1983"]'::tinterval;
-three|f1
------+---------------------------------------------------------------
- |["-infinity" "infinity"]
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ tinterval '["Aug 15 14:23:19 1983" "Sep 16 14:23:19 1983"]';
+ three | f1
+-------+-----------------------------------------------------------------
+ | ["-infinity" "infinity"]
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
(3 rows)
-QUERY: SET geqo TO 'off';
-QUERY: SELECT '' AS five, t1.f1, t2.f1
+SET geqo TO 'off';
+SELECT '' AS five, t1.f1, t2.f1
FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
WHERE t1.f1 && t2.f1 and
t1.f1 = t2.f1
ORDER BY t1.f1, t2.f1;
-five|f1 |f1
-----+---------------------------------------------------------------+---------------------------------------------------------------
- |["-infinity" "infinity"] |["-infinity" "infinity"]
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]|["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"] |["Thu Feb 15 12:15:03 1990 PST" "current"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"] |["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]|["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ five | f1 | f1
+------+-----------------------------------------------------------------+-----------------------------------------------------------------
+ | ["-infinity" "infinity"] | ["-infinity" "infinity"]
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"] | ["Thu Feb 15 12:15:03 1990 PST" "current"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"] | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
(5 rows)
-QUERY: SELECT '' AS fourteen, t1.f1 AS interval1, t2.f1 AS interval2
+SELECT '' AS fourteen, t1.f1 AS interval1, t2.f1 AS interval2
FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
WHERE t1.f1 && t2.f1 and not t1.f1 = t2.f1
ORDER BY interval1, interval2;
-fourteen|interval1 |interval2
---------+---------------------------------------------------------------+---------------------------------------------------------------
- |["-infinity" "infinity"] |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
- |["-infinity" "infinity"] |["Thu Feb 15 12:15:03 1990 PST" "current"]
- |["-infinity" "infinity"] |["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["-infinity" "infinity"] |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]|["-infinity" "infinity"]
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]|["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"] |["-infinity" "infinity"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"] |["epoch" "Mon May 01 00:30:30 1995 PDT"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"] |["-infinity" "infinity"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"] |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"] |["Thu Feb 15 12:15:03 1990 PST" "current"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"] |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]|["-infinity" "infinity"]
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]|["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ fourteen | interval1 | interval2
+----------+-----------------------------------------------------------------+-----------------------------------------------------------------
+ | ["-infinity" "infinity"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ | ["-infinity" "infinity"] | ["Thu Feb 15 12:15:03 1990 PST" "current"]
+ | ["-infinity" "infinity"] | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["-infinity" "infinity"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["-infinity" "infinity"]
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"] | ["-infinity" "infinity"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"] | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"] | ["-infinity" "infinity"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"] | ["Thu Feb 15 12:15:03 1990 PST" "current"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["-infinity" "infinity"]
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
(14 rows)
-QUERY: SELECT '' AS five, t1.f1
+-- contains
+SELECT '' AS five, t1.f1
FROM TINTERVAL_TBL t1
- WHERE not t1.f1 <<
- '["Aug 15 14:23:19 1980" "Sep 16 14:23:19 1990"]'::tinterval
+ WHERE not t1.f1 <<
+ tinterval '["Aug 15 14:23:19 1980" "Sep 16 14:23:19 1990"]'
ORDER BY t1.f1;
-five|f1
-----+---------------------------------------------------------------
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
- |["Thu Feb 15 12:15:03 1990 PST" "current"]
- |["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
+ five | f1
+------+-----------------------------------------------------------------
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ | ["Thu Feb 15 12:15:03 1990 PST" "current"]
+ | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
(3 rows)
-QUERY: SELECT '' AS three, t1.f1
+-- make time interval
+SELECT '' AS three, t1.f1
FROM TINTERVAL_TBL t1
WHERE t1.f1 &&
- ('Aug 15 14:23:19 1983'::abstime <#>
- 'Sep 16 14:23:19 1983'::abstime)
+ (abstime 'Aug 15 14:23:19 1983' <#>
+ abstime 'Sep 16 14:23:19 1983')
ORDER BY t1.f1;
-three|f1
------+---------------------------------------------------------------
- |["-infinity" "infinity"]
- |["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
- |["epoch" "Mon May 01 00:30:30 1995 PDT"]
+ three | f1
+-------+-----------------------------------------------------------------
+ | ["-infinity" "infinity"]
+ | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
+ | ["epoch" "Mon May 01 00:30:30 1995 PDT"]
(3 rows)
-QUERY: RESET geqo;
+RESET geqo;
-QUERY: SELECT p1.oid, p1.typname
+--
+-- TYPE_SANITY
+-- Sanity checks for common errors in making type-related system tables:
+-- pg_type, pg_class, pg_attribute.
+--
+-- None of the SELECTs here should ever find any matching entries,
+-- so the expected output is easy to maintain ;-).
+-- A test failure indicates someone messed up an entry in the system tables.
+--
+-- NB: we assume the oidjoins test will have caught any dangling links,
+-- that is OID or REGPROC fields that are not zero and do not match some
+-- row in the linked-to table. However, if we want to enforce that a link
+-- field can't be 0, we have to check it here.
+-- **************** pg_type ****************
+-- Look for illegal values in pg_type fields.
+SELECT p1.oid, p1.typname
FROM pg_type as p1
WHERE (p1.typlen <= 0 AND p1.typlen != -1) OR
(p1.typtype != 'b' AND p1.typtype != 'c') OR
NOT p1.typisdefined OR
(p1.typalign != 'c' AND p1.typalign != 's' AND
p1.typalign != 'i' AND p1.typalign != 'd');
-oid|typname
----+-------
+ oid | typname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.typname
+-- Look for "pass by value" types that can't be passed by value.
+SELECT p1.oid, p1.typname
FROM pg_type as p1
WHERE p1.typbyval AND
(p1.typlen != 1 OR p1.typalign != 'c') AND
(p1.typlen != 2 OR p1.typalign != 's') AND
(p1.typlen != 4 OR p1.typalign != 'i');
-oid|typname
----+-------
+ oid | typname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.typname
+-- Look for complex types that do not have a typrelid entry,
+-- or basic types that do.
+SELECT p1.oid, p1.typname
FROM pg_type as p1
WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR
(p1.typtype != 'c' AND p1.typrelid != 0);
-oid|typname
----+-------
+ oid | typname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.typname
+-- Conversion routines must be provided except in 'c' entries.
+SELECT p1.oid, p1.typname
FROM pg_type as p1
WHERE p1.typtype != 'c' AND
(p1.typinput = 0 OR p1.typoutput = 0 OR
p1.typreceive = 0 OR p1.typsend = 0);
-oid|typname
----+-------
+ oid | typname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.typname, p2.oid, p2.proname
+-- Check for bogus typinput routines
+-- FIXME: ought to check prorettype, but there are special cases that make it
+-- hard: prorettype might be binary-compatible with the type but not the same,
+-- and for array types array_in's result has nothing to do with anything.
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typinput = p2.oid AND p1.typtype = 'b' AND
(p2.pronargs != 1 OR p2.proretset) AND
(p2.pronargs != 3 OR p2.proretset OR p2.proargtypes[2] != 23);
-oid|typname|oid|proname
----+-------+---+-------
+ oid | typname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.typname, p2.oid, p2.proname
+-- Check for bogus typoutput routines
+-- The first OR subclause detects bogus non-array cases,
+-- the second one detects bogus array cases.
+-- FIXME: ought to check prorettype, but not clear what it should be.
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typoutput = p2.oid AND p1.typtype = 'b' AND
(p2.pronargs != 1 OR p2.proretset) AND
(p2.pronargs != 2 OR p2.proretset OR p1.typelem = 0);
-oid|typname|oid|proname
----+-------+---+-------
+ oid | typname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.typname, p2.oid, p2.proname
+-- Check for bogus typreceive routines
+-- FIXME: ought to check prorettype, but there are special cases that make it
+-- hard: prorettype might be binary-compatible with the type but not the same,
+-- and for array types array_in's result has nothing to do with anything.
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typreceive = p2.oid AND p1.typtype = 'b' AND
(p2.pronargs != 1 OR p2.proretset) AND
(p2.pronargs != 3 OR p2.proretset OR p2.proargtypes[2] != 23);
-oid|typname|oid|proname
----+-------+---+-------
+ oid | typname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.typname, p2.oid, p2.proname
+-- Check for bogus typsend routines
+-- The first OR subclause detects bogus non-array cases,
+-- the second one detects bogus array cases.
+-- FIXME: ought to check prorettype, but not clear what it should be.
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typsend = p2.oid AND p1.typtype = 'b' AND
(p2.pronargs != 1 OR p2.proretset) AND
(p2.pronargs != 2 OR p2.proretset OR p1.typelem = 0);
-oid|typname|oid|proname
----+-------+---+-------
+ oid | typname | oid | proname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.relname
+-- **************** pg_class ****************
+-- Look for illegal values in pg_class fields
+SELECT p1.oid, p1.relname
FROM pg_class as p1
WHERE (p1.relkind != 'r' AND p1.relkind != 'i' AND
p1.relkind != 's' AND p1.relkind != 'S');
-oid|relname
----+-------
+ oid | relname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.relname
+-- Indexes should have an access method, others not.
+SELECT p1.oid, p1.relname
FROM pg_class as p1
WHERE (p1.relkind = 'i' AND p1.relam = 0) OR
(p1.relkind != 'i' AND p1.relam != 0);
-oid|relname
----+-------
+ oid | relname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.attrelid, p1.attname
+-- **************** pg_attribute ****************
+-- Look for illegal values in pg_attribute fields
+SELECT p1.oid, p1.attrelid, p1.attname
FROM pg_attribute as p1
WHERE p1.attrelid = 0 OR p1.atttypid = 0 OR p1.attnum = 0 OR
p1.attcacheoff != -1;
-oid|attrelid|attname
----+--------+-------
+ oid | attrelid | attname
+-----+----------+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.attname, p2.oid, p2.attname
+-- Look for duplicate pg_attribute entries
+-- (This would not be necessary if the indexes on pg_attribute were UNIQUE?)
+SELECT p1.oid, p1.attname, p2.oid, p2.attname
FROM pg_attribute AS p1, pg_attribute AS p2
WHERE p1.oid != p2.oid AND
p1.attrelid = p2.attrelid AND
(p1.attname = p2.attname OR p1.attnum = p2.attnum);
-oid|attname|oid|attname
----+-------+---+-------
+ oid | attname | oid | attname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.attname, p2.oid, p2.relname
+-- Cross-check attnum against parent relation
+SELECT p1.oid, p1.attname, p2.oid, p2.relname
FROM pg_attribute AS p1, pg_class AS p2
WHERE p1.attrelid = p2.oid AND p1.attnum > p2.relnatts;
-oid|attname|oid|relname
----+-------+---+-------
+ oid | attname | oid | relname
+-----+---------+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.relname
+-- Detect missing pg_attribute entries: should have as many non-system
+-- attributes as parent relation expects
+SELECT p1.oid, p1.relname
FROM pg_class AS p1
WHERE p1.relnatts != (SELECT count(*) FROM pg_attribute AS p2
WHERE p2.attrelid = p1.oid AND p2.attnum > 0);
-oid|relname
----+-------
+ oid | relname
+-----+---------
(0 rows)
-QUERY: SELECT p1.oid, p1.attname, p2.oid, p2.typname
+-- Cross-check against pg_type entry
+SELECT p1.oid, p1.attname, p2.oid, p2.typname
FROM pg_attribute AS p1, pg_type AS p2
WHERE p1.atttypid = p2.oid AND
(p1.attlen != p2.typlen OR
p1.attalign != p2.typalign OR
p1.attbyval != p2.typbyval);
-oid|attname|oid|typname
----+-------+---+-------
+ oid | attname | oid | typname
+-----+---------+-----+---------
(0 rows)