~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/sql/time.sql

  • 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
 
 
5
CREATE TABLE TIME_TBL (f1 time(2));
 
6
 
 
7
INSERT INTO TIME_TBL VALUES ('00:00');
 
8
INSERT INTO TIME_TBL VALUES ('01:00');
 
9
-- as of 7.4, timezone spec should be accepted and ignored
 
10
INSERT INTO TIME_TBL VALUES ('02:03 PST');
 
11
INSERT INTO TIME_TBL VALUES ('11:59 EDT');
 
12
INSERT INTO TIME_TBL VALUES ('12:00');
 
13
INSERT INTO TIME_TBL VALUES ('12:01');
 
14
INSERT INTO TIME_TBL VALUES ('23:59');
 
15
INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
 
16
 
 
17
SELECT f1 AS "Time" FROM TIME_TBL;
 
18
 
 
19
SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
 
20
 
 
21
SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
 
22
 
 
23
SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
 
24
 
 
25
SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
 
26
 
 
27
--
 
28
-- TIME simple math
 
29
--
 
30
-- We now make a distinction between time and intervals,
 
31
-- and adding two times together makes no sense at all.
 
32
-- Leave in one query to show that it is rejected,
 
33
-- and do the rest of the testing in horology.sql
 
34
-- where we do mixed-type arithmetic. - thomas 2000-12-02
 
35
 
 
36
SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;