mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user