diff options
Diffstat (limited to 'src/test/regress/expected/path.out')
-rw-r--r-- | src/test/regress/expected/path.out | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/src/test/regress/expected/path.out b/src/test/regress/expected/path.out new file mode 100644 index 0000000..4994641 --- /dev/null +++ b/src/test/regress/expected/path.out @@ -0,0 +1,107 @@ +-- +-- 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 ('((10,20))'); -- Only one point +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 ('[]'); +ERROR: invalid input syntax for type path: "[]" +LINE 1: INSERT INTO PATH_TBL VALUES ('[]'); + ^ +INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]'); +ERROR: invalid input syntax for type path: "[(,2),(3,4)]" +LINE 1: INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]'); + ^ +INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)'); +ERROR: invalid input syntax for type path: "[(1,2),(3,4)" +LINE 1: INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)'); + ^ +INSERT INTO PATH_TBL VALUES ('(1,2,3,4'); +ERROR: invalid input syntax for type path: "(1,2,3,4" +LINE 1: INSERT INTO PATH_TBL VALUES ('(1,2,3,4'); + ^ +INSERT INTO PATH_TBL VALUES ('(1,2),(3,4)]'); +ERROR: invalid input syntax for type path: "(1,2),(3,4)]" +LINE 1: INSERT INTO PATH_TBL VALUES ('(1,2),(3,4)]'); + ^ +SELECT f1 AS open_path FROM PATH_TBL WHERE isopen(f1); + 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 f1 AS closed_path FROM PATH_TBL WHERE isclosed(f1); + closed_path +------------------- + ((1,2),(3,4)) + ((1,2),(3,4)) + ((1,2),(3,4)) + ((10,20)) + ((11,12),(13,14)) +(5 rows) + +SELECT pclose(f1) AS closed_path FROM PATH_TBL; + 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)) + ((10,20)) + ((11,12),(13,14)) + ((11,12),(13,14)) +(9 rows) + +SELECT popen(f1) AS open_path FROM PATH_TBL; + 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)] + [(10,20)] + [(11,12),(13,14)] + [(11,12),(13,14)] +(9 rows) + +-- test non-error-throwing API for some core types +SELECT pg_input_is_valid('[(1,2),(3)]', 'path'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('[(1,2),(3)]', 'path'); + message | detail | hint | sql_error_code +---------------------------------------------------+--------+------+---------------- + invalid input syntax for type path: "[(1,2),(3)]" | | | 22P02 +(1 row) + +SELECT pg_input_is_valid('[(1,2,6),(3,4,6)]', 'path'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('[(1,2,6),(3,4,6)]', 'path'); + message | detail | hint | sql_error_code +---------------------------------------------------------+--------+------+---------------- + invalid input syntax for type path: "[(1,2,6),(3,4,6)]" | | | 22P02 +(1 row) + |