merging many jsonb objects using aggregate functions in PostgreSQL?
I had the same problem and this post solved it:
https://blog.faraday.io/how-to-aggregate-jsonb-in-postgres/
The idea is to create an aggregate:

CREATE AGGREGATE jsonb_object_agg(jsonb) (
  SFUNC = 'jsonb_concat',
  STYPE = jsonb,
  INITCOND = '{}'
);


See the linked article for more details.