Re: SQL:2023 JSON simplified accessor support
Chao Li <li.evan.chao@gmail.com>
From: Chao Li <li.evan.chao@gmail.com>
To: Alexandra Wang <alexandra.wang.oss@gmail.com>
Cc: jian he <jian.universality@gmail.com>,
Nikita Malakhov <hukutoc@gmail.com>,
Vik Fearing <vik@postgresfriends.org>,
Mark Dilger <mark.dilger@enterprisedb.com>,
Matheus Alcantara <matheusssilv97@gmail.com>,
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>
Date: 2025-09-02T02:46:35Z
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 →
-
Add test coverage for indirection transformation
- 64492917280a 19 (unreleased) landed
-
Fix typo in comment
- 81a61fde84ff 19 (unreleased) landed
-
Implementation of subscripting for jsonb
- 676887a3b0b8 14.0 cited
> On Aug 27, 2025, at 15:26, Chao Li <li.evan.chao@gmail.com> wrote: > > diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h > index f7d07c84542..58a4b9df157 100644 > --- a/src/include/parser/parse_node.h > +++ b/src/include/parser/parse_node.h > @@ -361,7 +361,7 @@ extern SubscriptingRef *transformContainerSubscripts(ParseState *pstate, > Node *containerBase, > Oid containerType, > int32 containerTypMod, > - List *indirection, > + List **indirection, > bool isAssignment); > > Here we change “indirection” from * to **, I guess the reason is to indicate if the indirection list is fully processed. In case of fully processed, set it to NULL, then caller gets NULL via **. > > As “indirection” is of type “List *”, can we just set “indirection->length = 0”? I checked pg_list.h, there is not a function or macro to cleanup a list (free elements and reset length to 0). There is a “list_free(List *list)”, but it will free “list” itself as well. Maybe we can add a new function, say “list_reset(List *list)” or “list_cleanup(List *list)”. This way will keep the function interface unchanged, and less changes would be involved. After revisiting the changes, I take back this comment. Given the nature that List are always used in pointer form, my comment would just make things much more complicated. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/