diff options
Diffstat (limited to 'contrib/seg')
| -rw-r--r-- | contrib/seg/expected/seg.out | 24 | ||||
| -rw-r--r-- | contrib/seg/sql/seg.sql | 8 |
2 files changed, 20 insertions, 12 deletions
diff --git a/contrib/seg/expected/seg.out b/contrib/seg/expected/seg.out index 7a06113ed82..cd21139b5a7 100644 --- a/contrib/seg/expected/seg.out +++ b/contrib/seg/expected/seg.out @@ -1276,20 +1276,24 @@ 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 + errinfo.sql_error_code, + errinfo.message, + errinfo.detail, + errinfo.hint FROM unnest(ARRAY['-1 .. 1'::text, '100(+-)1', '', 'ABC', '1 e7', - '1e700']) str; - seg | ok | errmsg -----------+----+--------------------------------------- - -1 .. 1 | t | - 100(+-)1 | t | - | f | bad seg representation - ABC | f | bad seg representation - 1 e7 | f | bad seg representation - 1e700 | f | "1e700" is out of range for type real + '1e700']) str, + LATERAL pg_input_error_info(str, 'seg') as errinfo; + seg | ok | sql_error_code | message | detail | hint +----------+----+----------------+---------------------------------------+------------------------------+------ + -1 .. 1 | t | | | | + 100(+-)1 | t | | | | + | f | 42601 | bad seg representation | syntax error at end of input | + ABC | f | 42601 | bad seg representation | syntax error at or near "A" | + 1 e7 | f | 42601 | bad seg representation | syntax error at or near "e" | + 1e700 | f | 22003 | "1e700" is out of range for type real | | (6 rows) diff --git a/contrib/seg/sql/seg.sql b/contrib/seg/sql/seg.sql index b9a5d05d09f..c30f1f6bef1 100644 --- a/contrib/seg/sql/seg.sql +++ b/contrib/seg/sql/seg.sql @@ -244,10 +244,14 @@ FROM test_seg WHERE s @> '11.2..11.3' OR s IS NULL ORDER BY s; SELECT str as seg, pg_input_is_valid(str,'seg') as ok, - pg_input_error_message(str,'seg') as errmsg + errinfo.sql_error_code, + errinfo.message, + errinfo.detail, + errinfo.hint FROM unnest(ARRAY['-1 .. 1'::text, '100(+-)1', '', 'ABC', '1 e7', - '1e700']) str; + '1e700']) str, + LATERAL pg_input_error_info(str, 'seg') as errinfo; |
