Commit 9c3bbf25 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Alter the previous test for "time with time zone" implicit time zone

 (which failed miserably during DST) to just compare against a time
 derived from a timestamp value.
Certainly not a direct check for a correct result, but should work
 at any time of year.
parent a3ed622b
......@@ -135,6 +135,21 @@ SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
-- which may be either -08 or -07 depending on the time of year.
-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
-- Try the following two tests instead, as a poor substitute
SELECT CAST(date 'today' + time with time zone '01:30'
+ interval '02:01' AS time) AS "03:31:00";
03:31:00
----------
03:31:00
(1 row)
SELECT CAST(date 'today' + time with time zone '03:30'
+ interval '1 month 04:01' AS time) AS "07:31:00";
07:31:00
----------
07:31:00
(1 row)
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
You will have to retype this query using an explicit cast
......
......@@ -135,6 +135,21 @@ SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
-- which may be either -08 or -07 depending on the time of year.
-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
-- Try the following two tests instead, as a poor substitute
SELECT CAST(date 'today' + time with time zone '01:30'
+ interval '02:01' AS time) AS "03:31:00";
03:31:00
----------
03:31:00
(1 row)
SELECT CAST(date 'today' + time with time zone '03:30'
+ interval '1 month 04:01' AS time) AS "07:31:00";
07:31:00
----------
07:31:00
(1 row)
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
You will have to retype this query using an explicit cast
......
......@@ -135,6 +135,21 @@ SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
-- which may be either -08 or -07 depending on the time of year.
-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
-- Try the following two tests instead, as a poor substitute
SELECT CAST(date 'today' + time with time zone '01:30'
+ interval '02:01' AS time) AS "03:31:00";
03:31:00
----------
03:31:00
(1 row)
SELECT CAST(date 'today' + time with time zone '03:30'
+ interval '1 month 04:01' AS time) AS "07:31:00";
07:31:00
----------
07:31:00
(1 row)
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
You will have to retype this query using an explicit cast
......
......@@ -60,10 +60,15 @@ SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
-- These two tests cannot be used because they default to current timezone,
-- which may be either -08 or -07 depending on the time of year.
-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
-- Try the following two tests instead, as a poor substitute
SELECT CAST(date 'today' + time with time zone '01:30'
+ interval '02:01' AS time) AS "03:31:00";
SELECT CAST(date 'today' + time with time zone '03:30'
+ interval '1 month 04:01' AS time) AS "07:31:00";
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment