diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:44:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:44:03 +0000 |
commit | 293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch) | |
tree | fc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/test/regress/expected/lseg.out | |
parent | Initial commit. (diff) | |
download | postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip |
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/regress/expected/lseg.out')
-rw-r--r-- | src/test/regress/expected/lseg.out | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/test/regress/expected/lseg.out b/src/test/regress/expected/lseg.out new file mode 100644 index 0000000..c0375ac --- /dev/null +++ b/src/test/regress/expected/lseg.out @@ -0,0 +1,57 @@ +-- +-- LSEG +-- Line segments +-- +--DROP TABLE LSEG_TBL; +CREATE TABLE LSEG_TBL (s lseg); +INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)]'); +INSERT INTO LSEG_TBL VALUES ('(0,0),(6,6)'); +INSERT INTO LSEG_TBL VALUES ('10,-10 ,-3,-4'); +INSERT INTO LSEG_TBL VALUES ('[-1e6,2e2,3e5, -4e1]'); +INSERT INTO LSEG_TBL VALUES (lseg(point(11, 22), point(33,44))); +INSERT INTO LSEG_TBL VALUES ('[(-10,2),(-10,3)]'); -- vertical +INSERT INTO LSEG_TBL VALUES ('[(0,-20),(30,-20)]'); -- horizontal +INSERT INTO LSEG_TBL VALUES ('[(NaN,1),(NaN,90)]'); -- NaN +-- bad values for parser testing +INSERT INTO LSEG_TBL VALUES ('(3asdf,2 ,3,4r2)'); +ERROR: invalid input syntax for type lseg: "(3asdf,2 ,3,4r2)" +LINE 1: INSERT INTO LSEG_TBL VALUES ('(3asdf,2 ,3,4r2)'); + ^ +INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4'); +ERROR: invalid input syntax for type lseg: "[1,2,3, 4" +LINE 1: INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4'); + ^ +INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]'); +ERROR: invalid input syntax for type lseg: "[(,2),(3,4)]" +LINE 1: INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]'); + ^ +INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)'); +ERROR: invalid input syntax for type lseg: "[(1,2),(3,4)" +LINE 1: INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)'); + ^ +select * from LSEG_TBL; + s +------------------------------- + [(1,2),(3,4)] + [(0,0),(6,6)] + [(10,-10),(-3,-4)] + [(-1000000,200),(300000,-40)] + [(11,22),(33,44)] + [(-10,2),(-10,3)] + [(0,-20),(30,-20)] + [(NaN,1),(NaN,90)] +(8 rows) + +-- test non-error-throwing API for some core types +SELECT pg_input_is_valid('[(1,2),(3)]', 'lseg'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('[(1,2),(3)]', 'lseg'); + message | detail | hint | sql_error_code +---------------------------------------------------+--------+------+---------------- + invalid input syntax for type lseg: "[(1,2),(3)]" | | | 22P02 +(1 row) + |