summaryrefslogtreecommitdiff
path: root/contrib/hstore
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2023-02-28 08:04:13 +0900
committerMichael Paquier <michael@paquier.xyz>2023-02-28 08:04:13 +0900
commitb8da37b3ada2e547983538b3e49f8079f85ce120 (patch)
treed3ecf7af84a5b492e7a2b62b79df0398f3c8bccd /contrib/hstore
parent728560db7d868b3ded9a8675742083ab89bcff7c (diff)
downloadpostgresql-b8da37b3ada2e547983538b3e49f8079f85ce120.tar.gz
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/hstore')
-rw-r--r--contrib/hstore/expected/hstore.out16
-rw-r--r--contrib/hstore/sql/hstore.sql4
2 files changed, 10 insertions, 10 deletions
diff --git a/contrib/hstore/expected/hstore.out b/contrib/hstore/expected/hstore.out
index d6faa91867..1836c9acf3 100644
--- a/contrib/hstore/expected/hstore.out
+++ b/contrib/hstore/expected/hstore.out
@@ -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
diff --git a/contrib/hstore/sql/hstore.sql b/contrib/hstore/sql/hstore.sql
index 15f4f71416..efef91292a 100644
--- a/contrib/hstore/sql/hstore.sql
+++ b/contrib/hstore/sql/hstore.sql
@@ -60,8 +60,8 @@ select 'aa=>"'::hstore;
-- also try it with non-error-throwing API
select pg_input_is_valid('a=>b', 'hstore');
select pg_input_is_valid('a=b', 'hstore');
-select pg_input_error_message('a=b', 'hstore');
-select pg_input_error_message(' =>b', 'hstore');
+select * from pg_input_error_info('a=b', 'hstore');
+select * from pg_input_error_info(' =>b', 'hstore');
-- -> operator