Re: jsonb concatenate operator's semantics seem questionable
От
Jim Nasby
Тема
Re: jsonb concatenate operator's semantics seem questionable
Дата
Msg-id
555BC978.1000302@BlueTreble.com
Ответ на
Re: jsonb concatenate operator's semantics seem questionable (Marko Tiikkaja)
Список
Дерево обсуждения
jsonb concatenate operator's semantics seem questionable Peter Geoghegan <pg@heroku.com>
Re: jsonb concatenate operator's semantics seem questionable Robert Haas <robertmhaas@gmail.com>
Re: jsonb concatenate operator's semantics seem questionable Andrew Dunstan <andrew@dunslane.net>
Re: jsonb concatenate operator's semantics seem questionable Petr Jelinek <petr@2ndquadrant.com>
Re: jsonb concatenate operator's semantics seem questionable Dmitry Dolgov <9erthalion6@gmail.com>
Re: jsonb concatenate operator's semantics seem questionable Peter Geoghegan <pg@heroku.com>
Re: jsonb concatenate operator's semantics seem questionable Andrew Dunstan <andrew@dunslane.net>
Re: jsonb concatenate operator's semantics seem questionable Peter Geoghegan <pg@heroku.com>
Re: jsonb concatenate operator's semantics seem questionable Robert Haas <robertmhaas@gmail.com>
Re: jsonb concatenate operator's semantics seem questionable Peter Geoghegan <pg@heroku.com>
Re: jsonb concatenate operator's semantics seem questionable Peter Geoghegan <pg@heroku.com>
Re: jsonb concatenate operator's semantics seem questionable "Ilya I. Ashchepkov" <koctep@gmail.com>
On 5/18/15 3:15 PM, Marko Tiikkaja wrote: > On 2015-05-18 22:10, Josh Berkus wrote: >> On 05/18/2015 01:04 PM, Ryan Pedela wrote: >>> In the context of splitting shallow and deep merge into two operators, I >>> think + is better for shallow and || better for deep. The reason for + >>> is because many programming languages have this behavior. If I see the >>> below code in language I have never used before: >>> >>> objC = objA + objB >>> >>> My default assumption is that + performs a shallow merge. Like I said, I >>> would rather there just be one operator. >> >> Thank you, that helps. Anyone else? > > If everyone thinks the operators mean different things, we could just > not add any operators and only provide functions instead. My $0.02: I would expect || to be what I want to use to add something to an existing JSON document, no matter what the path of what I'm adding is. In other words, deep merge. I certainly wouldn't expect it to be shallow. If we get this wrong now, we'll be stuck with it forever. At a minimum I think we should use anything other than || until we can figure this out. That leaves || available for whichever case we decide on. BTW, if people are set on shallow merge being || then I'd suggest ||| as the deep merge operator. -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com
В списке pgsql-hackers по дате отправления
От: Peter Geoghegan
Дата: