4 CREATE TABLE TIME_TBL (f1 time(2));
5 INSERT INTO TIME_TBL VALUES ('00:00');
6 INSERT INTO TIME_TBL VALUES ('01:00');
7 -- as of 7.4, timezone spec should be accepted and ignored
8 INSERT INTO TIME_TBL VALUES ('02:03 PST');
9 INSERT INTO TIME_TBL VALUES ('11:59 EDT');
10 INSERT INTO TIME_TBL VALUES ('12:00');
11 INSERT INTO TIME_TBL VALUES ('12:01');
12 INSERT INTO TIME_TBL VALUES ('23:59');
13 INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
14 INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
15 INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
16 -- this should fail (the timezone offset is not known)
17 INSERT INTO TIME_TBL VALUES ('15:36:39 America/New_York');
18 ERROR: invalid input syntax for type time: "15:36:39 America/New_York"
19 LINE 1: INSERT INTO TIME_TBL VALUES ('15:36:39 America/New_York');
21 SELECT f1 AS "Time" FROM TIME_TBL;
36 SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
44 SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
56 SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
61 SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
79 -- We now make a distinction between time and intervals,
80 -- and adding two times together makes no sense at all.
81 -- Leave in one query to show that it is rejected,
82 -- and do the rest of the testing in horology.sql
83 -- where we do mixed-type arithmetic. - thomas 2000-12-02
84 SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
85 ERROR: operator is not unique: time without time zone + time without time zone
86 LINE 1: SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
88 HINT: Could not choose a best candidate operator. You might need to add explicit type casts.