On Mon, May 18, 2015 at 11:24 AM, Josh Berkus <j...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers