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

From Jelte Fennema-Nio
Subject Re: psql JSON output format
Date
Msg-id CAGECzQQD97b1sZCJ6jMF=hUnSSsqghoMZOgAyZA729590Vh50Q@mail.gmail.com
Whole thread Raw
In response to Re: psql JSON output format  (Christoph Berg <myon@debian.org>)
Responses Re: psql JSON output format
List pgsql-hackers
On Mon, 18 Dec 2023 at 16:38, Christoph Berg <myon@debian.org> wrote:
> We'd want both patches even if they do the same thing on two different
> levels, I'd say.

Makes sense. One thing I was still wondering is if it wouldn't be
easier to wrap all queries in "copy (select whatever) to stdout
(format json)" automatically when the -J flag is passed psql. Because
it would be nice not to have to implement this very similar logic in
two places.

But I guess that approach does not work for commands that don't work
inside COPY, i.e. DML and DDL. I'm assuming your current patch works
fine with DML/DDL. If that's indeed the case then I agree it makes
sense to have this patch. And another big benefit is that it wouldn't
require a new Postgres server function for the json functionality of
psql.



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Add --check option to pgindent
Next
From: Nathan Bossart
Date:
Subject: Re: micro-optimizing json.c