Re: psql JSON output format

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: psql JSON output format
Дата
Msg-id CAEZATCUMVzeQP3-B6L7atQ6aocaFwTf8wC0fL=-CAR_qKdPaYw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: psql JSON output format  (Christoph Berg <myon@debian.org>)
Ответы Re: psql JSON output format
Список pgsql-hackers
[cc'ing Joe]

On Tue, 9 Jan 2024 at 14:35, Christoph Berg <myon@debian.org> wrote:
>
> Getting it print numeric/boolean without quotes was actually easy, as
> well as json(b). Implemented as the attached v2 patch.
>
> But: not quoting json means that NULL and 'null'::json will both be
> rendered as 'null'. That strikes me as a pretty undesirable conflict.
> Does the COPY patch also do that?
>

Yes. Perhaps what needs to happen is for a NULL column to be omitted
entirely from the output. I think the COPY TO json patch would have to
do that if COPY FROM json were to be added later, to make it
round-trip safe.

> > OTOH, this patch outputs the Postgres string representation of the
> > object, which might be round-trip safe, but is not very convenient
> > for any other tool to read.
>
> For my use case, I need something that can be fed back into PG.
> Reassembling all the json parts back into proper values would be a
> pretty hard problem.
>

What is your use case? It seems like what you want is quite different
from the COPY patch.

Regards,
Dean



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Fix bogus Asserts in calc_non_nestloop_required_outer
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fix bogus Asserts in calc_non_nestloop_required_outer