Dan Coates
Photos
Writing
Projects
TIL
Me
← Back to TIL
Get postgres query results as JSON
postgres
Aug. 3, 2022
select
jsonb_agg
(
row_to_json
(
t
))
from
(
select
*
from
<
your
table
>
)
t