Re: JSON output from psql

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JSON output from psql
Date: 2020-05-11 20:42:41
Message-ID: CABwTF4WSGVF+BDVMG1O3AVYUrristMs9C5z2T+4v2i4AzWf+zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 11, 2020 at 1:24 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Fri, May 8, 2020 at 7:32 PM Gurjeet Singh <gurjeet(at)singh(dot)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.
>

That's a good point! It might still be desirable, perhaps for performance
trade-off of JSON conversion on the client-side instead of on the
server-side.

Best regards,
--
Gurjeet Singh http://gurjeet.singh.im/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-05-11 20:50:50 Re: PG 13 release notes, first draft
Previous Message Alvaro Herrera 2020-05-11 20:33:36 pg13: xlogreader API adjust