unnest() を実行できます 配列、例:
select id, jsonb_object_agg(tag, count) as tags
from (
select id, unnest(string_to_array(tags, ']')) as tag, count(*)
from my_table
group by 1, 2
) s
group by 1
order by 1
unnest() を実行できます 配列、例:
select id, jsonb_object_agg(tag, count) as tags
from (
select id, unnest(string_to_array(tags, ']')) as tag, count(*)
from my_table
group by 1, 2
) s
group by 1
order by 1