Re: Proposal: Add JSON support - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Proposal: Add JSON support
Date
Msg-id 4BB75CCD.1040906@dunslane.net
Whole thread Raw
In response to Re: Proposal: Add JSON support  (Mike Rylander <mrylander@gmail.com>)
Responses Re: Proposal: Add JSON support  (Joseph Adams <joeyadams3.14159@gmail.com>)
List pgsql-hackers

Mike Rylander wrote:
>>
>> Here's my idea: the datatype should only allow strict JSON, but there
>> should be a function that accepts a liberal format, cleans it up to
>> make it strict JSON, and converts it to JSON.  I think making strict
>> JSON the default makes the most sense because:
>>  * Inputs to the database will most likely be coming from programs, not humans.
>>  * Output is expected to be valid JSON and work anywhere JSON should work.
>>  * Strict JSON is what more people would expect, I'd think.
>>     
>
> +1
>
>   

Yeah. That's the only thing that makes sense to me. We don't allow badly 
formed XML, for example, although we do allow document fragments (as 
required by the standard, IIRC). But we could sensibly have some 
function like 'cleanup_json(almost_json text) returns json'.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: message clarifications
Next
From: Andrew Dunstan
Date:
Subject: pgindent cleanup