1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Convert hstore_in to report errors softly.

The error reporting here was not only old and crufty, but untested.
I took the opportunity to bring the messages into some sort of
compliance with our message style guidelines.

Discussion: https://postgr.es/m/6B6A5C77-60AD-4A71-9F3A-B2C026A281A6@dunslane.net
This commit is contained in:
Tom Lane
2022-12-27 14:50:56 -05:00
parent a5434c5258
commit 197f98a848
3 changed files with 133 additions and 28 deletions

View File

@ -53,6 +53,17 @@ select e'\\"a=>q"w'::hstore;
select ''::hstore;
select ' '::hstore;
-- invalid input
select ' =>null'::hstore;
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');
-- -> operator
select 'aa=>b, c=>d , b=>16'::hstore->'c';