-- what happens if we specify slightly misformatted abstime?
INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
ERROR: date/time field value out of range: "Feb 35, 1946 10:00:00"
-HINT: Perhaps you need a different DateStyle setting.
+HINT: Perhaps you need a different "datestyle" setting.
INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
ERROR: date/time field value out of range: "Feb 28, 1984 25:08:10"
-- badly formatted abstimes: these should result in invalid abstimes
INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
-ERROR: invalid input syntax for abstime: "bad date format"
+ERROR: invalid input syntax for type abstime: "bad date format"
INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
-- test abstime operators
SELECT '' AS eight, ABSTIME_TBL.*;
INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
-- test for over and under flow
INSERT INTO FLOAT4_TBL(f1) VALUES ('10e40');
-ERROR: float4 value out of range: overflow
+ERROR: type "real" value out of range: overflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e40');
-ERROR: float4 value out of range: overflow
+ERROR: type "real" value out of range: overflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-40');
-ERROR: float4 value out of range: underflow
+ERROR: type "real" value out of range: underflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-40');
-ERROR: float4 value out of range: underflow
+ERROR: type "real" value out of range: underflow
SELECT '' AS five, FLOAT4_TBL.*;
five | f1
------+--------------
SET f1 = FLOAT8_TBL.f1 * '-1'
WHERE FLOAT8_TBL.f1 > '0.0';
SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
-ERROR: float8 value out of range: overflow
+ERROR: type "double precision" value out of range: overflow
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: result is out of range
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
-ERROR: cannot take log of zero
+ERROR: cannot take logarithm of zero
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
-ERROR: cannot take log of a negative number
+ERROR: cannot take logarithm of a negative number
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
-ERROR: "10e400" is out of range for float8
+ERROR: "10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
-ERROR: "-10e400" is out of range for float8
+ERROR: "-10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
-ERROR: "10e-400" is out of range for float8
+ERROR: "10e-400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
-ERROR: "-10e-400" is out of range for float8
+ERROR: "-10e-400" is out of range for type double precision
-- maintain external table consistency across platforms
-- delete all values and reinsert well-behaved ones
DELETE FROM FLOAT8_TBL;
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: result is out of range
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
-ERROR: cannot take log of zero
+ERROR: cannot take logarithm of zero
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
-ERROR: cannot take log of a negative number
+ERROR: cannot take logarithm of a negative number
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
-ERROR: "10e400" is out of range for float8
+ERROR: "10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
-ERROR: "-10e400" is out of range for float8
+ERROR: "-10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
-ERROR: "10e-400" is out of range for float8
+ERROR: "10e-400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
-ERROR: "-10e-400" is out of range for float8
+ERROR: "-10e-400" is out of range for type double precision
-- maintain external table consistency across platforms
-- delete all values and reinsert well-behaved ones
DELETE FROM FLOAT8_TBL;
SET f1 = FLOAT8_TBL.f1 * '-1'
WHERE FLOAT8_TBL.f1 > '0.0';
SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
-ERROR: float8 value out of range: overflow
+ERROR: type "double precision" value out of range: overflow
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: result is out of range
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
-ERROR: cannot take log of zero
+ERROR: cannot take logarithm of zero
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
-ERROR: cannot take log of a negative number
+ERROR: cannot take logarithm of a negative number
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
-ERROR: "10e400" is out of range for float8
+ERROR: "10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
-ERROR: "-10e400" is out of range for float8
+ERROR: "-10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
-- maintain external table consistency across platforms
-- should fail in mdy mode:
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08"
-HINT: Perhaps you need a different DateStyle setting.
+HINT: Perhaps you need a different "datestyle" setting.
set datestyle to dmy;
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
timestamptz
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
ERROR: operator does not exist: date - time with time zone
-HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
+HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
--
-- timestamp, interval arithmetic
--
SELECT '' AS three, f1 as abstime, cast(f1 as timestamp) AS "timestamp"
FROM ABSTIME_TBL WHERE NOT isfinite(f1);
-ERROR: cannot convert "invalid" abstime to timestamp
+ERROR: cannot convert abstime "invalid" to timestamp
SELECT '' AS ten, f1 AS interval, reltime(f1) AS reltime
FROM INTERVAL_TBL;
ten | interval | reltime
-- should fail in mdy mode:
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08"
-HINT: Perhaps you need a different DateStyle setting.
+HINT: Perhaps you need a different "datestyle" setting.
set datestyle to dmy;
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
timestamptz
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
ERROR: operator does not exist: date - time with time zone
-HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
+HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
--
-- timestamp, interval arithmetic
--
SELECT '' AS three, f1 as abstime, cast(f1 as timestamp) AS "timestamp"
FROM ABSTIME_TBL WHERE NOT isfinite(f1);
-ERROR: cannot convert "invalid" abstime to timestamp
+ERROR: cannot convert abstime "invalid" to timestamp
SELECT '' AS ten, f1 AS interval, reltime(f1) AS reltime
FROM INTERVAL_TBL;
ten | interval | reltime
-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
-- failure expected
SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
-ERROR: column "test_missing_target.b" must appear in GROUP BY clause or used in an aggregate function
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
-- w/o existing GROUP BY target and w/o existing same ORDER BY target
SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
count
-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
-- failure expected
SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
-ERROR: column "test_missing_target.b" must appear in GROUP BY clause or used in an aggregate function
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
-- w/o existing GROUP BY target and w/o existing same ORDER BY target
SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
count
-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
-- failure expected
SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
-ERROR: attribute "test_missing_target.b" must be GROUPed or used in an aggregate function
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
-- w/o existing GROUP BY target and w/o existing same ORDER BY target
SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
count
-- group using reference number out of range
-- failure expected
SELECT c, count(*) FROM test_missing_target GROUP BY 3;
-ERROR: GROUP BY position 3 is not in target list
+ERROR: GROUP BY position 3 is not in select list
-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
-- failure expected
SELECT count(*) FROM test_missing_target x, test_missing_target y
-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
-- failure expected
SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
-ERROR: attribute "test_missing_target.b" must be GROUPed or used in an aggregate function
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
-- w/o existing GROUP BY target and w/o existing same ORDER BY target
SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
count
-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
-- failure expected
SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
-ERROR: attribute "test_missing_target.b" must be GROUPed or used in an aggregate function
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
-- w/o existing GROUP BY target and w/o existing same ORDER BY target
SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
count
-- group using reference number out of range
-- failure expected
SELECT c, count(*) FROM test_missing_target GROUP BY 3;
-ERROR: GROUP BY position 3 is not in target list
+ERROR: GROUP BY position 3 is not in select list
-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
-- failure expected
SELECT count(*) FROM test_missing_target x, test_missing_target y
-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
-- failure expected
SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
-ERROR: attribute "test_missing_target.b" must be GROUPed or used in an aggregate function
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
-- w/o existing GROUP BY target and w/o existing same ORDER BY target
SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
count
-- badly formatted tintervals
INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["bad time specifications" ""]');
-ERROR: invalid input syntax for abstime: "bad time specifications"
+ERROR: invalid input syntax for type abstime: "bad time specifications"
INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["" "infinity"]');
-ERROR: invalid input syntax for abstime: ""
+ERROR: invalid input syntax for type abstime: ""
-- test tinterval operators
SELECT '' AS five, TINTERVAL_TBL.*;
five | f1