Re: jsonb concatenate operator's semantics seem questionable

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: jsonb concatenate operator's semantics seem questionable
Дата
Msg-id CAM3SWZQ1zr9jezcCZFp7Da6U_J=abyy_Rv1=TUgwQsnFDHN_tA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonb concatenate operator's semantics seem questionable  (Petr Jelinek <petr@2ndquadrant.com>)
Список pgsql-hackers
On Sun, May 17, 2015 at 7:16 AM, Petr Jelinek <petr@2ndquadrant.com> wrote:
> Agreed, if you look at jquery for example, the extend() method by default
> behaves like our current || and you have to specify that you want deep merge
> if you want the behavior described by Peter. So there is definitely point
> for both, at this time we just support only one of them, that's all.

The difference is that with jquery's extend(), you can easily
subscript the JSON document you're extending so that you do so for the
right nested object (without merging any containers the target
contains, but rather overwriting them with any of the source's
containers -- makes sense when you're explicit about the nesting level
like that). With jsonb, however, we're usually stuck with having to
write an SQL expression that evaluates to the final jsonb document
that we want (for UPDATE targetlist assignment, typically).

This is an enormous difference. We still don't have a way to update a
nested object's single field that I can see, and nested objects are
absolutely commonplace for the "document database" use case. So I
don't accept that this is a matter of individual preference or taste.
It's a big, practical distinction.

-- 
Peter Geoghegan



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: jsonb concatenate operator's semantics seem questionable