key | value | col
----------------------------------------
color | red | g1
color | blue | g2
contrast | {'l':123456} | g1
setting | srnew | g2
contrast | {'s':123456} | g1
key | value | col
---------------------------------------------
color | ['red'] | g1
color | ['blue'] | g2
contrast | [{'l':123456}, {'s':456}]| g1
setting | ['srnew'] | g2
How would I aggregate the first table into the second table?
Column value is of type jsonb. I want the result column value to be jsonb too.