~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/expected/lseg.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
-- LSEG
 
3
-- Line segments
 
4
--
 
5
--DROP TABLE LSEG_TBL;
 
6
CREATE TABLE LSEG_TBL (s lseg);
 
7
INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)]');
 
8
INSERT INTO LSEG_TBL VALUES ('(0,0),(6,6)');
 
9
INSERT INTO LSEG_TBL VALUES ('10,-10 ,-3,-4');
 
10
INSERT INTO LSEG_TBL VALUES ('[-1e6,2e2,3e5, -4e1]');
 
11
INSERT INTO LSEG_TBL VALUES ('(11,22,33,44)');
 
12
-- bad values for parser testing
 
13
INSERT INTO LSEG_TBL VALUES ('(3asdf,2 ,3,4r2)');
 
14
ERROR:  invalid input syntax for type lseg: "(3asdf,2 ,3,4r2)"
 
15
INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4');
 
16
ERROR:  invalid input syntax for type lseg: "[1,2,3, 4"
 
17
INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]');
 
18
ERROR:  invalid input syntax for type lseg: "[(,2),(3,4)]"
 
19
INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)');
 
20
ERROR:  invalid input syntax for type lseg: "[(1,2),(3,4)"
 
21
select * from LSEG_TBL;
 
22
               s               
 
23
-------------------------------
 
24
 [(1,2),(3,4)]
 
25
 [(0,0),(6,6)]
 
26
 [(10,-10),(-3,-4)]
 
27
 [(-1000000,200),(300000,-40)]
 
28
 [(11,22),(33,44)]
 
29
(5 rows)
 
30
 
 
31
SELECT * FROM LSEG_TBL WHERE s <= lseg '[(1,2),(3,4)]';
 
32
       s       
 
33
---------------
 
34
 [(1,2),(3,4)]
 
35
(1 row)
 
36
 
 
37
SELECT * FROM LSEG_TBL WHERE (s <-> lseg '[(1,2),(3,4)]') < 10;
 
38
         s          
 
39
--------------------
 
40
 [(1,2),(3,4)]
 
41
 [(0,0),(6,6)]
 
42
 [(10,-10),(-3,-4)]
 
43
(3 rows)
 
44