Re: SQL:2023 JSON simplified accessor support
От | Chao Li |
---|---|
Тема | Re: SQL:2023 JSON simplified accessor support |
Дата | |
Msg-id | F24FAB6F-63D1-4F7D-83C9-09E76B561E11@gmail.com обсуждение исходный текст |
Ответ на | Re: SQL:2023 JSON simplified accessor support (Alexandra Wang <alexandra.wang.oss@gmail.com>) |
Список | pgsql-hackers |
On Sep 24, 2025, at 09:05, Alexandra Wang <alexandra.wang.oss@gmail.com> wrote:This is the expected behavior for array subscripting, and my patch
doesn't change that. I don't think this is a problem. With or without
my patch, you can avoid the ERROR by adding parentheses:test=# select ((p).meta[1])['a'] from people; meta ------ 30 (1 row)
Okay, make sense.
2 - 0002```+ /* Collect leading A_Indices subscripts */+ foreach(lc, indirection)+ {+ Node *n = lfirst(lc);++ if (IsA(n, A_Indices))+ {+ A_Indices *ai = (A_Indices *) n;++ subscriptlist = lappend(subscriptlist, n);+ if (ai->is_slice)+ isSlice = true;+ }+ else+ break;```We can break after “isSlice=true”.Why? We still want to get the whole prefix list of A_Indices.
Ah, I just realized the main goal of the foreach loop is to build a new “subscrptlist”. In that case, it should not break.
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
HighGo Software Co., Ltd.
https://www.highgo.com/
В списке pgsql-hackers по дате отправления: