pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christian Kruse <christian@2ndQuadrant.com>
To: David Johnston <polobo@yahoo.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
Date: Tue, 11 Mar 2014 08:50:30 +0100
Message-ID: <20140311075030.GC9524@defunct.ch> (raw)
In-Reply-To: <1394485742473-5795449.post@n5.nabble.com>
References: <20140310150952.398.53642@wrigleys.postgresql.org>
	<531E17E1.9020009@joh.to>
	<CA+tXr--Z7ap5mcaBVNKOi9NXd2MaZG9FO4t7cVj3cCMZjz+g6g@mail.gmail.com>
	<1394485742473-5795449.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hi,

On 10/03/14 14:09, David Johnston wrote:

> The system supposes that, at a structural level, you are dealing with
> column-consistent data and so if you ask for something that does not make
> sense (i.e., an object key when you have an array or a scalar) it will warn
> you.

Looking at the common usage of JSON it doesn't seem to be a good idea
to imply column-consistent JSON. Normally when JSON is used the
application ensures consistency and when a non-existent key is
accessed NULL is returned. I think this is expected behavior and we
should do it like that, too; if one wants it different, he should use
CHECK constraints.

Best regards,

-- 
 Christian Kruse               http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

view thread (14+ messages)  latest in thread

Message-ID: <20140311075030.GC9524@defunct.ch>
Permalink:  ../20140311075030.GC9524@defunct.ch/
Also on:    postgresql.org/message-id/20140311075030.GC9524@defunct.ch

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: christian@2ndQuadrant.com, polobo@yahoo.com
  Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
  In-Reply-To: <20140311075030.GC9524@defunct.ch>
  References: <20140310150952.398.53642@wrigleys.postgresql.org> <531E17E1.9020009@joh.to> <CA+tXr--Z7ap5mcaBVNKOi9NXd2MaZG9FO4t7cVj3cCMZjz+g6g@mail.gmail.com> <1394485742473-5795449.post@n5.nabble.com> <20140311075030.GC9524@defunct.ch>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox