mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
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.
This commit is contained in:
parent
a3ed622b63
commit
9c3bbf256b
@ -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.
|
-- 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 '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";
|
-- 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";
|
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
|
||||||
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
|
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
|
||||||
You will have to retype this query using an explicit cast
|
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.
|
-- 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 '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";
|
-- 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";
|
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
|
||||||
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
|
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
|
||||||
You will have to retype this query using an explicit cast
|
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.
|
-- 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 '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";
|
-- 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";
|
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
|
||||||
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
|
ERROR: Unable to identify an operator '-' for types 'interval' and 'timetz'
|
||||||
You will have to retype this query using an explicit cast
|
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,
|
-- 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.
|
-- 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 '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";
|
-- 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";
|
SELECT interval '04:30' - time with time zone '01:02' AS "+03:28";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user