hi.
create domain d1 as text collate case_insensitive;
select json_value('{"a": "A"}', '$.a' returning d1 default 'C' on
empty) = 'a'; --return true
select json_value('{"a": "A"}', '$.c' returning d1 default 'A' on
empty) = 'a'; --return true
select json_value('{"a": "A"}', '$.c' returning d1 default 'A' collate
"C" on empty) = 'a';
currently the above query will produce an error:
ERROR: unrecognized node type: 31
this error message needs to be fixed.
however, if no error is raised, should the query return true or false?
if not error out, It also means that the collation of the json_value expression
is determined at runtime, which makes it unsuitable for use in index creation or
check constraints.
overall, raising an error if the collation of the
JsonBehavior DEFAULT clause differs from that of the RETURNING clause
is the best option.
what do you think?