ranyeli
2/5/2019 - 2:53 AM

Query Result to JSON

select array_to_json(array_agg(row_to_json(t)))
  from (
    select id, text from words
  ) t