Re: jsonb concatenate operator's semantics seem questionable

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, Ryan Pedela <rpedela(at)datalanche(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Ilya Ashchepkov <koctep(at)gmail(dot)com>
Subject: Re: jsonb concatenate operator's semantics seem questionable
Date: 2015-05-22 20:59:35
Message-ID: 555F98B7.7090806@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/22/15 2:44 PM, Andrew Dunstan wrote:
>
> On 05/22/2015 03:27 PM, Peter Geoghegan wrote:
>> On Fri, May 22, 2015 at 11:59 AM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>> wrote:
>>> 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.
>> I think that that's a bad default behavior, although I don't think
>> that's what Jim means. Consider our experience with having subscript
>> operators throw errors -- it complicates certain cases (my complaint
>> at the time was about expression indexes, but there are others).
>>
>
>
> I certainly agree about indexable operations. However this seems
> unlikely to be indexed, although I'm prepared to be educated on that point.
>
> Still I'd rather not add yet another parameter to the function, and I
> certainly don't want to make throwing an error the only behaviour.

If instead of a create_missing boolean it accepted an enum we could
handle both (since they're related). But I'd also like to avoid Yet More
Knobs if possible.

I think there's essentially two scenarios for JSON usage; one where you
want to be pretty paranoid about things like keys aren't missing, you're
not trying to access a path that doesn't exist, etc. The other mode
(what we have today) is when you really don't care much about that stuff
and want the database to JustStoreIt. I don't know how many people would
want the stricter mode, but it certainly seems painful to try and
enforce that stuff today if you care about it.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2015-05-22 21:30:18 Asynchronous DRAM Self-Refresh
Previous Message Jim Nasby 2015-05-22 20:49:58 Re: Change pg_cancel_*() to ignore current backend