(1 row)
SET DateStyle = 'ISO';
--- Reject time without time zone having a time zone specified
+-- As of 7.4, allow time without time zone having a time zone specified
SELECT time without time zone '040506.789+08';
-ERROR: Bad time external representation '040506.789+08'
+ time
+---------------
+ 04:05:06.7890
+(1 row)
+
SELECT time without time zone '040506.789-08';
-ERROR: Bad time external representation '040506.789-08'
+ time
+---------------
+ 04:05:06.7890
+(1 row)
+
SELECT time without time zone 'T040506.789+08';
-ERROR: Bad time external representation 'T040506.789+08'
+ time
+---------------
+ 04:05:06.7890
+(1 row)
+
SELECT time without time zone 'T040506.789-08';
-ERROR: Bad time external representation 'T040506.789-08'
+ time
+---------------
+ 04:05:06.7890
+(1 row)
+
SELECT time with time zone '040506.789+08';
timetz
------------------
(1 row)
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
-ERROR: Unable to identify an operator '-' for types 'date' and 'time with time zone'
- You will have to retype this query using an explicit cast
+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.
--
-- timestamp, interval arithmetic
--
Fri Dec 31 23:59:59 1999
(1 row)
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days' AS "Feb 23, 285506";
+ Feb 23, 285506
+----------------------------
+ Fri Feb 23 00:00:00 285506
+(1 row)
+
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
+ Jan 20, 288244
+----------------------------
+ Sat Jan 20 00:00:00 288244
+(1 row)
+
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
+ Dec 31, 294276
+----------------------------
+ Sun Dec 31 00:00:00 294276
+(1 row)
+
+SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
+ 106751991 Days
+------------------
+ @ 106751991 days
+(1 row)
+
-- Shorthand values
-- Not directly usable for regression testing since these are not constants.
-- So, just try to test parser and hope for the best - thomas 97/04/26
--
SET DateStyle TO 'US,Postgres';
SHOW DateStyle;
- DateStyle
---------------------------------------------
- Postgres with US (NonEuropean) conventions
+ DateStyle
+--------------
+ Postgres, US
(1 row)
SELECT '' AS "64", d1 AS us_postgres FROM TIMESTAMP_TBL;
SET DateStyle TO 'US,SQL';
SHOW DateStyle;
- DateStyle
----------------------------------------
- SQL with US (NonEuropean) conventions
+ DateStyle
+-----------
+ SQL, US
(1 row)
SELECT '' AS "64", d1 AS us_sql FROM TIMESTAMP_TBL;
SET DateStyle TO 'European,Postgres';
SHOW DateStyle;
- DateStyle
-------------------------------------
- Postgres with European conventions
+ DateStyle
+--------------------
+ Postgres, European
(1 row)
INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
SET DateStyle TO 'European,ISO';
SHOW DateStyle;
- DateStyle
--------------------------------
- ISO with European conventions
+ DateStyle
+---------------
+ ISO, European
(1 row)
SELECT '' AS "65", d1 AS european_iso FROM TIMESTAMP_TBL;
SET DateStyle TO 'European,SQL';
SHOW DateStyle;
- DateStyle
--------------------------------
- SQL with European conventions
+ DateStyle
+---------------
+ SQL, European
(1 row)
SELECT '' AS "65", d1 AS european_sql FROM TIMESTAMP_TBL;