1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Rework pg_input_error_message(), now renamed pg_input_error_info()

pg_input_error_info() is now a SQL function able to return a row with
more than just the error message generated for incorrect data type
inputs when these are able to handle soft failures, returning more
contents of ErrorData, as of:
- The error message (same as before).
- The error detail, if set.
- The error hint, if set.
- SQL error code.

All the regression tests that relied on pg_input_error_message() are
updated to reflect the effects of the rename.

Per discussion with Tom Lane and Andrew Dunstan.

Author: Nathan Bossart
Discussion: https://postgr.es/m/139a68e1-bd1f-a9a7-b5fe-0be9845c6311@dunslane.net
This commit is contained in:
Michael Paquier
2023-02-28 08:04:13 +09:00
parent 728560db7d
commit b8da37b3ad
117 changed files with 768 additions and 682 deletions

View File

@ -265,16 +265,16 @@ select pg_input_is_valid('a=b', 'hstore');
f
(1 row)
select pg_input_error_message('a=b', 'hstore');
pg_input_error_message
------------------------------------------------
syntax error in hstore, near "b" at position 2
select * from pg_input_error_info('a=b', 'hstore');
message | detail | hint | sql_error_code
------------------------------------------------+--------+------+----------------
syntax error in hstore, near "b" at position 2 | | | 42601
(1 row)
select pg_input_error_message(' =>b', 'hstore');
pg_input_error_message
------------------------------------------------
syntax error in hstore, near "=" at position 1
select * from pg_input_error_info(' =>b', 'hstore');
message | detail | hint | sql_error_code
------------------------------------------------+--------+------+----------------
syntax error in hstore, near "=" at position 1 | | | 42601
(1 row)
-- -> operator