On Mon, Jun 26, 2023, at 13:06, jian he wrote:
> Can you try to glue the attached to the hashset data type input
> function.
> the attached will parse cstring with double quote and not. so '{1,2,3}'
> == '{"1","2","3"}'. obviously quote will preserve the inner string as
> is.
> currently int4hashset input is delimited by comma, if you want deal
> with range then you need escape the comma.
Not sure what you're trying to do here; what's the problem with
the current int4hashset_in()?
I think it might be best to focus on null semantics / three-valued logic
before moving on and trying to implement support for more types,
otherwise we would need to rewrite more code if we find general
thinkos that are problems in all types.
Help wanted to reason about what the following queries should return:
SELECT hashset_union(NULL::int4hashset, '{}'::int4hashset);
SELECT hashset_intersection(NULL::int4hashset, '{}'::int4hashset);
SELECT hashset_difference(NULL::int4hashset, '{}'::int4hashset);
SELECT hashset_symmetric_difference(NULL::int4hashset, '{}'::int4hashset);
Should they return NULL, the empty set or something else?
I've renamed hashset_merge() -> hashset_union() to better match
SQL's MULTISET feature which has a MULTISET UNION.
/Joel