Comment Comment by newaccoutnas There's also json_build_object for building a JSON object and then you can use json_agg inside that. parent newaccoutnas 7 years ago