Here is an example if you want to get a list of keys for each object:
select array_agg(json_keys),id from ( select json_object_keys(json_stuff) as json_keys,id from table) a group by a.id
Here id
is the identifier or unique value of each row. If the string cannot be distinguished by identifier, it might be better to try PL/pgSQL
.
source share