Re: additional json functionality - Mailing list pgsql-hackers

From Tom Lane
Subject Re: additional json functionality
Date
Msg-id 30087.1384972565@sss.pgh.pa.us
Whole thread Raw
In response to Re: additional json functionality  (David Johnston <polobo@yahoo.com>)
Responses Re: additional json functionality
List pgsql-hackers
David Johnston <polobo@yahoo.com> writes:
>> On 11/18/2013 06:13 AM, Peter Eisentraut wrote:
>>> We could do something like SQL/XML and specify the level of "validity"
>>> in a typmod, e.g., json(loose), json(strict), etc.

> Three things:

> 1) How would this work in the face of functions that erase typemod
> information?

You'd have to make the data self-identifying (which I think was the plan
already), and ensure that *every* function taking "json" could cope with
both formats on input.  The typmod could only be expected to be enforced
when storing or explicitly casting to one subformat, much like operations
on "numeric" pay little attention to the original precision/scale if any.

I agree that this solution isn't terribly workable, mainly because it'd
break any third-party C functions that take json today.
        regards, tom lane



pgsql-hackers by date:

Previous
From: David Johnston
Date:
Subject: Re: WITH ORDINALITY versus column definition lists
Next
From: Christopher Browne
Date:
Subject: Re: Add CREATE support to event triggers