Re: Proposal to use JSON for Postgres Parser format - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Proposal to use JSON for Postgres Parser format
Date
Msg-id CAH2-WznFVmaYqmRck-t27MN6=g7iO-Y8VbXkDuUECEBYnjm2jA@mail.gmail.com
Whole thread Raw
In response to Re: Proposal to use JSON for Postgres Parser format  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposal to use JSON for Postgres Parser format
List pgsql-hackers
On Mon, Sep 19, 2022 at 7:29 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Maybe a compromise could be found whereby we provide a conversion
> function that converts whatever the catalog storage format is to
> some JSON equivalent.  That would address the needs of external
> code that doesn't want to write a custom parser, while not tying
> us directly to JSON.

That seems like a perfectly good solution, as long as it can be done
in a way that doesn't leave consumers of the JSON output at any kind
of disadvantage.

I find the current node tree format ludicrously verbose, and generally
hard to work with. But it's not the format itself, really -- that's
not the problem. The underlying data structures are typically very
information dense. So having an output format that's a known quantity
sounds very valuable to me.

Writing declarative @> containment queries against (say) a JSON
variant of node tree format seems like it could be a huge quality of
life improvement.  It will make the output format even more verbose,
but that might not matter in the same way as it does right now.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Support pg_attribute_aligned and noreturn in MSVC
Next
From: Nathan Bossart
Date:
Subject: Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures