summaryrefslogtreecommitdiff
path: root/contrib/seg/sql
diff options
context:
space:
mode:
authorAndrew Dunstan2022-12-23 14:17:24 +0000
committerAndrew Dunstan2022-12-23 14:17:24 +0000
commit878ce16056c087e2dcd7cc31cd7e4700f407a770 (patch)
treea70260dcd16c84ea40222a753105998f867b486b /contrib/seg/sql
parent7a310338f4dd3195376477d502e93fba5f165769 (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.sql13
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;