Re: Trailing comma support in SELECT statements
От | Jim Nasby |
---|---|
Тема | Re: Trailing comma support in SELECT statements |
Дата | |
Msg-id | 5445AF5C.7090302@BlueTreble.com обсуждение исходный текст |
Ответ на | Re: Trailing comma support in SELECT statements (Andrew Dunstan <andrew@dunslane.net>) |
Ответы |
Re: Trailing comma support in SELECT statements
|
Список | pgsql-hackers |
On 10/20/14, 11:16 AM, Andrew Dunstan wrote: > 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 toallow it for json (and by implication jsonb, since they use literally the same parser - in fact we do that precisely sotheir input grammars can't diverge). +1. Data types that implement specs should follow the spec. I was more concerned about things like polygon, but the real point (ha!) is that we need to think about the data types too.(I will say I don't think things that mandate an exact number of elements (like point, box, etc) should support extradelimiters). -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com
В списке pgsql-hackers по дате отправления: