Re: jsonb concatenate operator's semantics seem questionable

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: jsonb concatenate operator's semantics seem questionable
Дата
Msg-id CAM3SWZQe4Motoc+ZB46N6--9b2r0Jpcbr=cTumLs1gWwJ702ng@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonb concatenate operator's semantics seem questionable  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
On Mon, May 18, 2015 at 11:24 AM, Josh Berkus <josh@agliodbs.com> wrote:
> On 05/17/2015 09:11 PM, Peter Geoghegan wrote:> As I said, I don't think
> that my preference for deep concatenation is
>> a matter of taste. I think that shallow concatenation is fundamentally
>> and objectively at odds with what jsonb is supposed to be (as long as
>> concatenation is the way "nested assignment" works, which is what
>> users have been taught to think).
>
> That was a really wordy way to not answer my question.  Everyone wants
> deep append.  We don't have it.  Unless you have a finished, tested
> patch you're sitting on, that discussion isn't relevant with the sole
> exception of whether we want to reserve "||" for it.

The point of not using "||" is to distance this from the update hstore
idiom. It won't work here in the way I expected.

> On 05/18/2015 08:57 AM, Ryan Pedela wrote:
>> If not, deep concatenation would solve this problem, but I can also see
>> another solution. Use + for shallow concatenation since it really means
>> "add element to top-level path" as Peter suggests. Then add another
>> function: jsonb_add( target jsonb, path text[], new jsonb ) to add
>> element at any arbitrary path. Then leave || for deep concatenation in
>> 9.6 or whenever.
>
> Since swapping the operator seems still on the table, is there any
> particular reason why you think "+" is more suited to shallow
> concatination?  Both you and Peter have said this, but as a heavy user
> of JSON/JSONB, to me it seems the other way around.  That is, "+" says
> "add to arbitrary nested node" to me more than "||" does.

I'm not necessarily attached to "+". I just want to make this
different to hstore's "||" operator. There should be a similar idiom
with jsonb, but that can come later.

-- 
Peter Geoghegan



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: jsonb concatenate operator's semantics seem questionable
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: jsonb concatenate operator's semantics seem questionable