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 LINE 1: INSERT INTO LSEG_TBL VALUES ('(3asdf,2 ,3,4r2)');
17 INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4');
18 ERROR: invalid input syntax for type lseg: "[1,2,3, 4"
19 LINE 1: INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4');
21 INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]');
22 ERROR: invalid input syntax for type lseg: "[(,2),(3,4)]"
23 LINE 1: INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]');
25 INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)');
26 ERROR: invalid input syntax for type lseg: "[(1,2),(3,4)"
27 LINE 1: INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)');
29 select * from LSEG_TBL;
31 -------------------------------
35 [(-1000000,200),(300000,-40)]
39 SELECT * FROM LSEG_TBL WHERE s <= lseg '[(1,2),(3,4)]';
45 SELECT * FROM LSEG_TBL WHERE (s <-> lseg '[(1,2),(3,4)]') < 10;