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
SELECT f1 AS "Time" FROM TIME_TBL;
27
SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
35
SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
45
SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
50
SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
66
-- We now make a distinction between time and intervals,
67
-- and adding two times together makes no sense at all.
68
-- Leave in one query to show that it is rejected,
69
-- and do the rest of the testing in horology.sql
70
-- where we do mixed-type arithmetic. - thomas 2000-12-02
71
SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
72
ERROR: operator is not unique: time without time zone + time without time zone
73
HINT: Could not choose a best candidate operator. You may need to add explicit type casts.