diff options
author | Andrew Dunstan | 2022-12-23 14:17:24 +0000 |
---|---|---|
committer | Andrew Dunstan | 2022-12-23 14:17:24 +0000 |
commit | 878ce16056c087e2dcd7cc31cd7e4700f407a770 (patch) | |
tree | a70260dcd16c84ea40222a753105998f867b486b /contrib/seg/sql | |
parent | 7a310338f4dd3195376477d502e93fba5f165769 (diff) |
Convert contrib/seg's input function to report errors softly
Reviewed by Tom Lane
Discussion: https://postgr.es/m/a8dc5700-c341-3ba8-0507-cc09881e6200@dunslane.net
Diffstat (limited to 'contrib/seg/sql')
-rw-r--r-- | contrib/seg/sql/seg.sql | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/seg/sql/seg.sql b/contrib/seg/sql/seg.sql index a027d4de97e..b9a5d05d09f 100644 --- a/contrib/seg/sql/seg.sql +++ b/contrib/seg/sql/seg.sql @@ -238,3 +238,16 @@ SELECT * FROM test_seg WHERE s @> '11..11.3' GROUP BY s; -- Test functions SELECT seg_lower(s), seg_center(s), seg_upper(s) FROM test_seg WHERE s @> '11.2..11.3' OR s IS NULL ORDER BY s; + + +-- test non error throwing API + +SELECT str as seg, + pg_input_is_valid(str,'seg') as ok, + pg_input_error_message(str,'seg') as errmsg +FROM unnest(ARRAY['-1 .. 1'::text, + '100(+-)1', + '', + 'ABC', + '1 e7', + '1e700']) str; |