Re: JSON output from psql - Mailing list pgsql-hackers

From Robert Haas
Subject Re: JSON output from psql
Date
Msg-id CA+TgmoahevkF=czqJMkb=-zDL+ENXF95ZSQy0qa6KX=jk-9pqA@mail.gmail.com
Whole thread Raw
In response to Re: JSON output from psql  (Gurjeet Singh <gurjeet@singh.im>)
Responses Re: JSON output from psql  (Gurjeet Singh <gurjeet@singh.im>)
List pgsql-hackers
On Fri, May 8, 2020 at 7:32 PM Gurjeet Singh <gurjeet@singh.im> wrote:
> There's no standard format that comes to mind, but perhaps an output format similar to that of (array of
row_to_json())would be desirable. For example, `select relname, relnamespace from pg_class;` would emit the following:
 
>
> [
> {"relname": "pgclass", "relnamespace": 11},
> {"relname": "pg_statistic", "relnamespace": 11},
> ]

I don't see why psql needs any special support. You can already
generate this using the existing server side functions, if you want
it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: making update/delete of inheritance trees scale better
Next
From: Robert Haas
Date:
Subject: Re: making update/delete of inheritance trees scale better