With regard to previous conversations:
I want to try following approach to make the array-style subscripting more
generic and allow using it for different types with less effort:
* Introduce generic node type instead of the `ArrayRef` (and `JsonbRef` from
* Make generic version of `transformArraySubscript` /
`transformAssignmentSubscript` / `ExecEvalArrayRef` etc
[transformSubscripting / ExecEvalSubscripting etc]
* Introduce a new pg_type column with type `regproc` to point out a
handle all type-related logic for generic `ExecEval` function
[typsubscripting]. If value of this column is null, type doesn't support
There is still question about indexing of such kind of expressions. To be
honest I haven't figured it out in details yet how to do it (except simple
btree index for an each path like `create index jsonb_data_idx on
But I believe that this can be achieved subsequently, since in case of
data using the array-style subscripting it's no more than alias or syntactic
So I have few questions:
* Is it whole plan looks ok?
* Any suggestions about names (especially for column in pg_type)?
* Is it ok to implement indexing separately (since the main purpose of
array-style subscripting for jsonb is an update operation)?