mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 00:31:14 +02:00
feb4f44d29
terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
76 lines
2.1 KiB
Plaintext
76 lines
2.1 KiB
Plaintext
--
|
|
-- PATH
|
|
--
|
|
--DROP TABLE PATH_TBL;
|
|
CREATE TABLE PATH_TBL (f1 path);
|
|
INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)]');
|
|
INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
|
|
INSERT INTO PATH_TBL VALUES ('[(0,0),(3,0),(4,5),(1,6)]');
|
|
INSERT INTO PATH_TBL VALUES ('((1,2),(3,4))');
|
|
INSERT INTO PATH_TBL VALUES ('1,2 ,3,4');
|
|
INSERT INTO PATH_TBL VALUES ('[1,2,3, 4]');
|
|
INSERT INTO PATH_TBL VALUES ('[11,12,13,14]');
|
|
INSERT INTO PATH_TBL VALUES ('(11,12,13,14)');
|
|
-- bad values for parser testing
|
|
INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]');
|
|
ERROR: invalid input syntax for type path: "[(,2),(3,4)]"
|
|
INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)');
|
|
ERROR: invalid input syntax for type path: "[(1,2),(3,4)"
|
|
SELECT f1 FROM PATH_TBL;
|
|
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);
|
|
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);
|
|
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;
|
|
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;
|
|
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)
|
|
|