Jsonb array-style subscripting, generic version

Поиск
Список
Период
Сортировка
От Dmitry Dolgov
Тема Jsonb array-style subscripting, generic version
Дата
Msg-id CA+q6zcVzfhNXnMZATgd7UOFPP2By_B_ciMJw8ETvezSnn5bZKg@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi

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
  patch) [SubscriptingRef]
* Make generic version of `transformArraySubscript` /
  `transformAssignmentSubscript` / `ExecEvalArrayRef` etc
  [transformSubscripting / ExecEvalSubscripting etc]
* Introduce a new pg_type column with type `regproc` to point out a function to
  handle all type-related logic for generic `ExecEval` function
  [typsubscripting]. If value of this column is null, type doesn't support
  array-style subscripting

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 jsonb_table ((jsonb_data['key']))`).
But I believe that this can be achieved subsequently, since in case of getting
data using the array-style subscripting it's no more than alias or syntactic
sugar.

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)?

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: seg fault in contrib/bloom
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Parameters don't work in FETCH NEXT clause?