Re: BUG #9519: Allows storing scalar json, but fails when querying - Mailing list pgsql-bugs

From Marko Tiikkaja
Subject Re: BUG #9519: Allows storing scalar json, but fails when querying
Date
Msg-id 531E17E1.9020009@joh.to
Whole thread Raw
In response to BUG #9519: Allows storing scalar json, but fails when querying  (alf.kristian@gmail.com)
Responses Re: BUG #9519: Allows storing scalar json, but fails when querying  (John R Pierce <pierce@hogranch.com>)
Re: BUG #9519: Allows storing scalar json, but fails when querying  (Alf Kristian Støyle <alf.kristian@gmail.com>)
List pgsql-bugs
On 3/10/14, 4:09 PM, alf.kristian@gmail.com wrote:
> I think the insert should fail, since '1' is not valid JSON.

It's a valid "JSON value", it's just not an object.  If you only want to
store JSON objects in the table, consider using a CHECK constraint.


Regards,
Marko Tiikkaja

pgsql-bugs by date:

Previous
From: alf.kristian@gmail.com
Date:
Subject: BUG #9519: Allows storing scalar json, but fails when querying
Next
From: John R Pierce
Date:
Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying