Re: [HACKERS] jsonb_delete with arrays

Поиск
Список
Период
Сортировка
От Dmitry Dolgov
Тема Re: [HACKERS] jsonb_delete with arrays
Дата
Msg-id CA+q6zcUb3YkLqKn5CLGbepo4PJScFVLKBNWOG2ewhU6X+wRW5w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonb_delete with arrays  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: [HACKERS] jsonb_delete with arrays  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Attached is an implantation of jsonb_delete that instead of taking a single key to remove accepts an array of keys

Since I already saw this patch, here is my small review.

Speaking about implementation of `jsonb_delete_array` - it's fine, but I would like to suggest two modifications:

* create a separate helper function for jsonb delete operation, to use it in both `jsonb_delete` and `jsonb_delete_array`. It will help to concentrate related logic in one place.

* use variadic arguments for `jsonb_delete_array`. For rare cases, when someone decides to use this function directly instead of corresponding operator. It will be more consistent with `jsonb_delete` from my point of view, because it's transition from `jsonb_delete(data, 'key')` to `jsonb_delete(data, 'key1', 'key2')` is more smooth, than to `jsonb_delete(data, '{key1, key2}')`.

I've attached a patch with these modifications. What do you think?
Вложения

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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: [HACKERS] CREATE OR REPLACE VIEW bug
Следующее
От: Steve Singer
Дата:
Сообщение: Re: [HACKERS] Logical Replication WIP