~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/expected/time.out

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
SELECT f1 AS "Time" FROM TIME_TBL;
 
15
    Time     
 
16
-------------
 
17
 00:00:00
 
18
 01:00:00
 
19
 02:03:00
 
20
 11:59:00
 
21
 12:00:00
 
22
 12:01:00
 
23
 23:59:00
 
24
 23:59:59.99
 
25
(8 rows)
 
26
 
 
27
SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
 
28
  Three   
 
29
----------
 
30
 00:00:00
 
31
 01:00:00
 
32
 02:03:00
 
33
(3 rows)
 
34
 
 
35
SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
 
36
    Five     
 
37
-------------
 
38
 11:59:00
 
39
 12:00:00
 
40
 12:01:00
 
41
 23:59:00
 
42
 23:59:59.99
 
43
(5 rows)
 
44
 
 
45
SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
 
46
 None 
 
47
------
 
48
(0 rows)
 
49
 
 
50
SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
 
51
    Eight    
 
52
-------------
 
53
 00:00:00
 
54
 01:00:00
 
55
 02:03:00
 
56
 11:59:00
 
57
 12:00:00
 
58
 12:01:00
 
59
 23:59:00
 
60
 23:59:59.99
 
61
(8 rows)
 
62
 
 
63
--
 
64
-- TIME simple math
 
65
--
 
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.