> On Sep 24, 2025, at 09:05, Alexandra Wang <[email protected]>
> 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.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/