]> granicus.if.org Git - postgresql/blob - src/test/regress/expected/time.out
Remove useless whitespace at end of lines
[postgresql] / src / test / regress / expected / time.out
1 --
2 -- TIME
3 --
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');
20                                      ^
21 SELECT f1 AS "Time" FROM TIME_TBL;
22     Time     
23 -------------
24  00:00:00
25  01:00:00
26  02:03:00
27  11:59:00
28  12:00:00
29  12:01:00
30  23:59:00
31  23:59:59.99
32  15:36:39
33  15:36:39
34 (10 rows)
35
36 SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
37   Three   
38 ----------
39  00:00:00
40  01:00:00
41  02:03:00
42 (3 rows)
43
44 SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
45     Five     
46 -------------
47  11:59:00
48  12:00:00
49  12:01:00
50  23:59:00
51  23:59:59.99
52  15:36:39
53  15:36:39
54 (7 rows)
55
56 SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
57  None 
58 ------
59 (0 rows)
60
61 SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
62     Eight    
63 -------------
64  00:00:00
65  01:00:00
66  02:03:00
67  11:59:00
68  12:00:00
69  12:01:00
70  23:59:00
71  23:59:59.99
72  15:36:39
73  15:36:39
74 (10 rows)
75
76 --
77 -- TIME simple math
78 --
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;
87                   ^
88 HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.