| From: | Josh Berkus <josh(at)agliodbs(dot)com> | 
|---|---|
| To: | Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: jsonb array-style subscripting | 
| Date: | 2015-08-20 20:44:16 | 
| Message-ID: | 55D63C20.7080803@agliodbs.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 08/20/2015 12:24 PM, Jim Nasby wrote:
> On 8/17/15 4:25 PM, Josh Berkus wrote:
>> On 08/17/2015 02:18 PM, Jim Nasby wrote:
>>> >On 8/17/15 3:33 PM, Josh Berkus wrote:
>>>> >>Again, how do we handle missing keys?  Just return NULL?  or
>>>> ERROR?  I'd
>>>> >>prefer the former, but there will be arguments the other way.
>>> >
>>> >I've been wondering if we should add some kind of "strict" JSON. My big
>>> >concern is throwing an error if you try to provide duplicate keys, but
>>> >it seems reasonable that json_strict would throw an error if you try to
>>> >reference something that doesn't exist.
>> Only if there's demand for it.  Is there?
> 
> I'm certainly worried (paranoid?) about it. Postgres is very good about
> not silently dropping data and this seems a glaring departure from that.
> I haven't looked yet but I'm hoping this could at least be added as an
> extension without duplicating a bunch of the existing JSON stuff.
There's a big difference between silently dropping data and implicitly
creating it. As I said, the only reason I could see wanting a strict
mode is because AppDev users expect it to be consistent with their
programming languages.  Otherwise, from a user perspective, being able
to create a whole nested chain in one statement is a big win.
What could be added as an extension?
-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Guillaume Lelarge | 2015-08-20 21:04:37 | Re: Annotating pg_dump/pg_restore | 
| Previous Message | Andrew Dunstan | 2015-08-20 20:37:45 | Re: jsonb array-style subscripting |