aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>2001-04-06 05:50:29 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>2001-04-06 05:50:29 +0000
commit9c3bbf256b8b54c0cb0a915c1abbad3cf53e76ef (patch)
tree067a86be4df7ac21e1105fc4cb34c1917a6b3801
parenta3ed622b63bb897e58b66e1e589113c6e6c45e80 (diff)
downloadpostgresql-9c3bbf256b8b54c0cb0a915c1abbad3cf53e76ef.tar.gz
postgresql-9c3bbf256b8b54c0cb0a915c1abbad3cf53e76ef.zip
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.
-rw-r--r--src/test/regress/expected/horology-no-DST-before-1970.out15
-rw-r--r--src/test/regress/expected/horology-solaris-1947.out15
-rw-r--r--src/test/regress/expected/horology.out15
-rw-r--r--src/test/regress/sql/horology.sql9
4 files changed, 52 insertions, 2 deletions
diff --git a/src/test/regress/expected/horology-no-DST-before-1970.out b/src/test/regress/expected/horology-no-DST-before-1970.out
index 6adc5d9ef6d..18ca744d785 100644
--- a/src/test/regress/expected/horology-no-DST-before-1970.out
+++ b/src/test/regress/expected/horology-no-DST-before-1970.out
@@ -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
diff --git a/src/test/regress/expected/horology-solaris-1947.out b/src/test/regress/expected/horology-solaris-1947.out
index dad40d14956..451c6a6c765 100644
--- a/src/test/regress/expected/horology-solaris-1947.out
+++ b/src/test/regress/expected/horology-solaris-1947.out
@@ -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
diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out
index 0e39d5e9535..dc16d58dea9 100644
--- a/src/test/regress/expected/horology.out
+++ b/src/test/regress/expected/horology.out
@@ -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
diff --git a/src/test/regress/sql/horology.sql b/src/test/regress/sql/horology.sql
index 0ad1d9cd300..2350064d839 100644
--- a/src/test/regress/sql/horology.sql
+++ b/src/test/regress/sql/horology.sql
@@ -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";