By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 3 Duplicates: 0 Warnings: 0
| json_object('id', id, 'name', name) |
|---|
| {"id": 2, "name": "Bar"} |
| json_arrayagg(json_object('id', id, 'name', name)) |
|---|
| [{"id": 1, "name": "Foo"},{"id": 3, "name": "Baz"}] |