Re: jsonb concatenate operator's semantics seem questionable - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: jsonb concatenate operator's semantics seem questionable
Date
Msg-id 555F7C86.4070809@dunslane.net
Whole thread Raw
In response to Re: jsonb concatenate operator's semantics seem questionable  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: jsonb concatenate operator's semantics seem questionable  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On 05/22/2015 02:38 PM, Jim Nasby wrote:
> On 5/21/15 4:25 PM, Andrew Dunstan wrote:
>> Here is a patch that renames jsonb_replace to jsonb_set with a boolean
>> create_missing flag that defaults to false (should we default it to
>> true?). With the flag set it's more or less upsert for jsonb. Without,
>> it's just update.
>
> I think upsert is probably the more expected behavior.
>
> Though, I'm also wondering if we should allow for throwing an error if 
> path doesn't already exist (it looks like if create_missing is false 
> it silently does nothing right now?)

Yes, that's actually documented in the patch.

As for raising an error, in principle it's doable, but the code to 
detect it might get messy. Also, I don't want a huge number of knobs. So 
I'm excited about the idea.

cheers

andrew




pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Change pg_cancel_*() to ignore current backend
Next
From: Peter Geoghegan
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.