(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
--
Feb 23, 285506
----------------------------
Fri Feb 23 00:00:00 285506
- (1 row)
-
+(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)
-
+(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)
-
+(1 row)
+
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
106751991 Days
------------------
--
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;