Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNHS5-0001ut-JJ for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Mar 2014 07:50:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WNHS5-0004F8-2o for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Mar 2014 07:50:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNHS4-0004EA-E7 for pgsql-bugs@postgresql.org; Tue, 11 Mar 2014 07:50:16 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNHS1-0002N8-W8 for pgsql-bugs@postgresql.org; Tue, 11 Mar 2014 07:50:15 +0000 Received: from localhost (c-83-233-130-233.cust.bredband2.com [83.233.130.233]) by mrelayeu.kundenserver.de (node=mreue101) with ESMTP (Nemesis) id 0LpwXf-1Wqaij03hX-00fmVB; Tue, 11 Mar 2014 08:50:10 +0100 Date: Tue, 11 Mar 2014 08:50:30 +0100 From: Christian Kruse To: David Johnston Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying Message-ID: <20140311075030.GC9524@defunct.ch> References: <20140310150952.398.53642@wrigleys.postgresql.org> <531E17E1.9020009@joh.to> <1394485742473-5795449.post@n5.nabble.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wLAMOaPNJ0fu1fTG" Content-Disposition: inline In-Reply-To: <1394485742473-5795449.post@n5.nabble.com> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) X-Provags-ID: V02:K0:GweugAQoXTmi4t4HGd2w7V90kHAgU7rWtoG1CfYrTiF cYeawCD2F75i+BzQqB+OGmuAcHfATzUHswmhp1j1zphyZpOlS4 wu43mS6GhRhEkJICsBb2Isp2joOB5wZ5U31vwZ/KxoTwI7k63e buittZIFPHPbiFilJp1jI2K/id6f3i+xlfFqCe3l0/vNYl61V1 EF/fCHtiAIHv5k7MzoagKJ3Iv3sW2Jz4C3ynyJrUevQKvZqiQl FpoitAz4a6N9fLct8R2O5J7ye24YRt2uAlIoP/3I6cFomGJoW5 50KKjXCg52Kj5qev1VeF/wH6XKTPv8w6tZUIAIVB5QgctvMVDw XUQ/OaZlEV9UrmIu8urhRSFTi6qXYcrcSgRn0l7xx X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --wLAMOaPNJ0fu1fTG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wa= rn > 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, --=20 Christian Kruse http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --wLAMOaPNJ0fu1fTG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: GPGTools - http://gpgtools.org iQQcBAEBCAAGBQJTHsBGAAoJEEnjDsXITviXc5MgAIKaqy/2G2t5ooMfUtyhOkuS wG1ByVmNrD61OvcO13gHZ25oWy6VbtMsJlQ4LYrjKJ/l4PGr6z6C4ITQSA9ZNBh7 Ngwf96a3mH+mJldRdY+F5WclDcOUxRMxeAJfARtL9i0gyBMvWsyBRJ0xvK0rEfuH iGjXT/jd5h5k0QJWi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DQv7Ay/LIbP039MfmV2/PLJKEgBlIaYiICy4 flCYE/NEEXd2qSroZMzvVgu/AmyDaMGJqDrxcDU+L/M7irFxP8Sqm03H4pCGOzQ= =5O5a -----END PGP SIGNATURE----- --wLAMOaPNJ0fu1fTG--