Re: [PATH] Jsonb, insert a new value into an array at arbitrary position

Поиск
Список
Период
Сортировка
От Dmitry Dolgov
Тема Re: [PATH] Jsonb, insert a new value into an array at arbitrary position
Дата
Msg-id CA+q6zcWmzEdwYa8Hao2NxGn2LAGnUs38b_zPtW-8n6iqKPzEjw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATH] Jsonb, insert a new value into an array at arbitrary position  (David Steele <david@pgmasters.net>)
Ответы Re: [PATH] Jsonb, insert a new value into an array at arbitrary position  (Petr Jelinek <petr@2ndquadrant.com>)
Re: [PATH] Jsonb, insert a new value into an array at arbitrary position  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Список pgsql-hackers
Hi Vitaly, thanks for the review. I've attached a new version of path with improvements. Few notes:

> 7. Why did you remove "skip"? It is a comment what "true" means...

Actually, I thought that this comment was about skipping an element from jsonb in order to change/delete it,
not about the last argument.  E.g. you can find several occurrences of `JsonbIteratorNext` with `true` as the last
argument but without a "last argument is about skip" comment.
And there is a piece of code in the function `jsonb_delete` with a "skip element" commentary:

```
/* skip corresponding value as well */
if (r == WJB_KEY)
    JsonbIteratorNext(&it, &v, true);
```

So since in this patch it's not a simple skipping for setPathArray, I removed that commentary. Am I wrong?

> 9. And finally... it does not work as expected in case of:

Yes, good catch, thanks.
Вложения

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: TAP / recovery-test fs-level backups, psql enhancements etc
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: IF (NOT) EXISTS in psql-completion