json_object_agg_unique ( key "any", value "any" ) → jsonCollects all the key/value pairs into a JSON object. Key arguments are coerced to text; value arguments are converted as per
to_json or to_jsonb. Values can be null, but keys cannot. If there is a duplicate key an error is thrown.