Re: Trailing comma support in SELECT statements - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Trailing comma support in SELECT statements
Date
Msg-id 54453574.4030106@dunslane.net
Whole thread Raw
In response to Re: Trailing comma support in SELECT statements  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: Trailing comma support in SELECT statements
List pgsql-hackers
On 10/20/2014 11:59 AM, David E. Wheeler wrote:
> On Oct 18, 2014, at 7:06 PM, Jim Nasby <Jim.Nasby@BlueTreble.com> wrote:
>
>> Yes.
>>
>> The only case I can think of where we wouldn't want this is COPY.
>>
>> BTW, this should also apply to delimiters other than commas; for example, some geometry types use ; as a delimiter
betweenpoints. 
> I don’t think it should apply to the internals of types, necessarily. JSON, for example, always dies on an trailing
comma,so should probably stay that way. Well, maybe allow it on JSONB input, but not JSON. Though we perhaps don’t want
theirbehaviors to diverge. 
>


The JSON spec is quite clear on this. Leading and trailing commas are
not allowed. I would fight tooth and nail not to allow it for json (and
by implication jsonb, since they use literally the same parser - in fact
we do that precisely so their input grammars can't diverge).

cheers

andrew



pgsql-hackers by date:

Previous
From: David G Johnston
Date:
Subject: Re: Would you help to review our modifications
Next
From: Robert Haas
Date:
Subject: Re: Superuser connect during smart shutdown