diff options
| author | Michael Paquier <michael@paquier.xyz> | 2023-02-28 08:04:13 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2023-02-28 08:04:13 +0900 |
| commit | b8da37b3ada2e547983538b3e49f8079f85ce120 (patch) | |
| tree | d3ecf7af84a5b492e7a2b62b79df0398f3c8bccd /contrib/intarray/sql | |
| parent | 728560db7d868b3ded9a8675742083ab89bcff7c (diff) | |
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
Diffstat (limited to 'contrib/intarray/sql')
| -rw-r--r-- | contrib/intarray/sql/_int.sql | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/intarray/sql/_int.sql b/contrib/intarray/sql/_int.sql index 4c9ba4c1fb9..d9d987bdb1a 100644 --- a/contrib/intarray/sql/_int.sql +++ b/contrib/intarray/sql/_int.sql @@ -79,11 +79,15 @@ SELECT '1&(2&(4&(5|!6)))'::query_int; SELECT str as "query_int", pg_input_is_valid(str,'query_int') as ok, - pg_input_error_message(str,'query_int') as errmsg + errinfo.sql_error_code, + errinfo.message, + errinfo.detail, + errinfo.hint FROM (VALUES ('1&(2&(4&(5|6)))'), ('1#(2&(4&(5&6)))'), ('foo')) - AS a(str); + AS a(str), + LATERAL pg_input_error_info(a.str, 'query_int') as errinfo; |
