array_to_json 2014-02-02 code postgresqljsonsql SELECT array_to_json(array_agg(books)) FROM (SELECT isbn, author, title FROM my_books) AS books;