In https://www.postgresql.org/docs/18/datatype-json.html#JSONB-SUBSCRIPTING
a row of the table says:
"
[subscript, ...]
Array element accessor. subscript can be given in two forms: index or
start_index to end_index. The first form returns a single array element by
its index. The second form returns an array slice by the range of indexes,
including the elements that correspond to the provided start_index and
end_index.
"
I infer from "[subscript, ...]" that several items can be specified. How
the range is specified is not clear to me since it can't be a comma as it
is the delimiter of arguments and something like "index_start to index_end"
("[2 to 3, 5 to 6]") seems unlikely.
I tried to find how it works in the source code but couldn't since I'm not
versed in C. If someone can find it and provide a clarification, I'll be
glad to propose a patch for it.
Thanks,
Rodrigo