Convert postgres array to jsonb How we can convert postgres array :- ARRAY['{"id": "1"}', '{"id": "2"}'] to JSONB '[{"id": "1"}, {"id": "2"}]'
The array_to_json function with a cast to jsonb accomplishes this.

Example: select array_to_json(ARRAY['{"id": "1"}', '{"id": "2"}'])::jsonb;