Re: Trailing comma support in SELECT statements

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Alex Goncharov <alex(dot)goncharov(dot)usa(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Trailing comma support in SELECT statements
Date: 2014-10-29 16:01:06
Message-ID: CA+TgmoZvH3G7_tQb9owaUM1+JAU1ku0Ts9y1CUHzr5LOvZfQtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 28, 2014 at 7:59 PM, David Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> I'd be much more inclined to favor this if the user is provided a capability
> to have warnings emitted whenever extraneous commas are present - either via
> some form of strict mode or linting configuration.

My experience with this kind of thing has not been positive. You
write all your code in strict mode and have it turned on server-wide,
and then you want to install an extension which doesn't use strict
mode and you have to turn it off, but then you lose your own checks.
Uggh.

I think the discussion here is an example of taking a questionable
idea to its illogical conclusion. I don't believe that a decision to
allow a trailing comma in a SELECT list means that we also have to
allow trailing commas in every single kind of comma-separated list we
have anywhere in PostgreSQL, right down to some obscure type's input
functions. That's taking a simple idea that might possibly be worth
considering and expanding it into a giant project that nobody's ever
going to do, and certainly not correctly.

My personal vote is for not changing anything here at all. But I
don't think it's got to be all-or-nothing.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-10-29 16:03:54 Re: Directory/File Access Permissions for COPY and Generic File Access Functions
Previous Message Andres Freund 2014-10-29 16:00:59 Re: Directory/File Access Permissions for COPY and Generic File Access Functions