Re: SQL:2023 JSON simplified accessor support

Alexandra Wang <alexandra.wang.oss@gmail.com>

From: Alexandra Wang <alexandra.wang.oss@gmail.com>
To: Matheus Alcantara <matheusssilv97@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, Andrew Dunstan <andrew@dunslane.net>, Nikita Glukhov <glukhov.n.a@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, "David E. Wheeler" <david@justatheory.com>, jian he <jian.universality@gmail.com>
Date: 2025-03-03T20:22:49Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add test coverage for indirection transformation

  2. Fix typo in comment

  3. Implementation of subscripting for jsonb

Attachments

Hi Matheus,

On Mon, Mar 3, 2025 at 1:43 PM Matheus Alcantara <matheusssilv97@gmail.com>
wrote:

> On Mon, Mar 3, 2025 at 4:16 PM Matheus Alcantara
> <matheusssilv97@gmail.com> wrote:
> >
> > Hi Alex,
> >
> > The code comments and the commit messages help a lot when reviewing!
> Thanks for
> > the new version.
> >
> > The code LGTM and check-world is happy. I've also performed some tests
> and
> > everything looks good!

> Just some minor points about this new version:
> >
> > ## v9-0005
> >
> > Typo on commit message title

> ## v9-0006
> >
> > > + * The following functions create various types of JsonPathParseItem
> nodes,
> > > + * which are used to build JsonPath expressions for jsonb simplified
> accessor.
> > >
> > Just to avoid misinterpretation I think that we can replace "The
> following
> > functions" with "The make_jsonpath_item_* functions" since we can have
> more
> > functions in the future that are not fully related with these. Does that
> make
> > sense?
>

Thank you so much for reviewing! I've attached v10, which addresses your
feedback.

On Mon, Mar 3, 2025 at 1:43 PM Matheus Alcantara <matheusssilv97@gmail.com>
wrote:

> Sorry, I've forgotten to include a question. Do you have anything in mind
> about
> documentation changes for this patch?
>

For the documentation, I’m thinking of adding it under JSON Types [1].
I’d either add a new “Simple Dot-Notation” section after jsonb
subscripting [2] or replace it. Let me know what you think.

[1] https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSON
[2]
https://www.postgresql.org/docs/current/datatype-json.html#JSONB-SUBSCRIPTING

Best,
Alex