summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/path.out
blob: e38377981aa29df673d055afc1117189eca10378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--
-- PATH
--
--DROP TABLE PATH_TBL;
CREATE TABLE PATH_TBL (ID int, f1 path);
INSERT INTO PATH_TBL VALUES (1,'[(1,2),(3,4)]');
INSERT INTO PATH_TBL VALUES (2,'((1,2),(3,4))');
INSERT INTO PATH_TBL VALUES (3,'[(0,0),(3,0),(4,5),(1,6)]');
INSERT INTO PATH_TBL VALUES (4, '((1,2),(3,4))');
INSERT INTO PATH_TBL VALUES (5, '1,2 ,3,4');
INSERT INTO PATH_TBL VALUES (6, '[1,2,3, 4]');
INSERT INTO PATH_TBL VALUES (7, '[11,12,13,14]');
INSERT INTO PATH_TBL VALUES (8, '(11,12,13,14)');
-- bad values for parser testing
INSERT INTO PATH_TBL VALUES (9, '[(,2),(3,4)]');
ERROR:  invalid input syntax for type path: "[(,2),(3,4)]"
LINE 1: INSERT INTO PATH_TBL VALUES (9, '[(,2),(3,4)]');
                                        ^
INSERT INTO PATH_TBL VALUES (10, '[(1,2),(3,4)');
ERROR:  invalid input syntax for type path: "[(1,2),(3,4)"
LINE 1: INSERT INTO PATH_TBL VALUES (10, '[(1,2),(3,4)');
                                         ^
SELECT f1 FROM PATH_TBL ORDER BY ID;
            f1             
---------------------------
 [(1,2),(3,4)]
 ((1,2),(3,4))
 [(0,0),(3,0),(4,5),(1,6)]
 ((1,2),(3,4))
 ((1,2),(3,4))
 [(1,2),(3,4)]
 [(11,12),(13,14)]
 ((11,12),(13,14))
(8 rows)

SELECT '' AS count, f1 AS open_path FROM PATH_TBL WHERE isopen(f1) ORDER BY ID;
 count |         open_path         
-------+---------------------------
       | [(1,2),(3,4)]
       | [(0,0),(3,0),(4,5),(1,6)]
       | [(1,2),(3,4)]
       | [(11,12),(13,14)]
(4 rows)

SELECT '' AS count, f1 AS closed_path FROM PATH_TBL WHERE isclosed(f1) ORDER BY ID;
 count |    closed_path    
-------+-------------------
       | ((1,2),(3,4))
       | ((1,2),(3,4))
       | ((1,2),(3,4))
       | ((11,12),(13,14))
(4 rows)

SELECT '' AS count, pclose(f1) AS closed_path FROM PATH_TBL ORDER BY ID;
 count |        closed_path        
-------+---------------------------
       | ((1,2),(3,4))
       | ((1,2),(3,4))
       | ((0,0),(3,0),(4,5),(1,6))
       | ((1,2),(3,4))
       | ((1,2),(3,4))
       | ((1,2),(3,4))
       | ((11,12),(13,14))
       | ((11,12),(13,14))
(8 rows)

SELECT '' AS count, popen(f1) AS open_path FROM PATH_TBL ORDER BY ID;
 count |         open_path         
-------+---------------------------
       | [(1,2),(3,4)]
       | [(1,2),(3,4)]
       | [(0,0),(3,0),(4,5),(1,6)]
       | [(1,2),(3,4)]
       | [(1,2),(3,4)]
       | [(1,2),(3,4)]
       | [(11,12),(13,14)]
       | [(11,12),(13,14)]
(8 rows)