Re: psql JSON output format

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: psql JSON output format
Date: 2023-12-18 16:33:53
Message-ID: CAGECzQQD97b1sZCJ6jMF=hUnSSsqghoMZOgAyZA729590Vh50Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 18 Dec 2023 at 16:38, Christoph Berg <myon(at)debian(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-12-18 16:41:35 Re: micro-optimizing json.c
Previous Message Jelte Fennema-Nio 2023-12-18 16:15:59 Re: Add --check option to pgindent