5 CREATE TABLE PATH_TBL (f1 path);
6 INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)]');
7 INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
8 INSERT INTO PATH_TBL VALUES ('[(0,0),(3,0),(4,5),(1,6)]');
9 INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
10 INSERT INTO PATH_TBL VALUES ('1,2 ,3,4');
11 INSERT INTO PATH_TBL VALUES ('[1,2,3, 4]');
12 INSERT INTO PATH_TBL VALUES ('[11,12,13,14]');
13 INSERT INTO PATH_TBL VALUES ('(11,12,13,14)');
14 -- bad values for parser testing
15 INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]');
16 ERROR: invalid input syntax for type path: "[(,2),(3,4)]"
17 LINE 1: INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]');
19 INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)');
20 ERROR: invalid input syntax for type path: "[(1,2),(3,4)"
21 LINE 1: INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)');
23 SELECT f1 FROM PATH_TBL;
25 ---------------------------
28 [(0,0),(3,0),(4,5),(1,6)]
36 SELECT '' AS count, f1 AS open_path FROM PATH_TBL WHERE isopen(f1);
38 -------+---------------------------
40 | [(0,0),(3,0),(4,5),(1,6)]
45 SELECT '' AS count, f1 AS closed_path FROM PATH_TBL WHERE isclosed(f1);
47 -------+-------------------
54 SELECT '' AS count, pclose(f1) AS closed_path FROM PATH_TBL;
56 -------+---------------------------
59 | ((0,0),(3,0),(4,5),(1,6))
67 SELECT '' AS count, popen(f1) AS open_path FROM PATH_TBL;
69 -------+---------------------------
72 | [(0,0),(3,0),(4,5),(1,6)]