Re: Trailing comma support in SELECT statements

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Trailing comma support in SELECT statements
Дата
Msg-id CA+TgmoZvH3G7_tQb9owaUM1+JAU1ku0Ts9y1CUHzr5LOvZfQtQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Trailing comma support in SELECT statements  (David Johnston <david.g.johnston@gmail.com>)
Список pgsql-hackers
On Tue, Oct 28, 2014 at 7:59 PM, David Johnston
<david.g.johnston@gmail.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Directory/File Access Permissions for COPY and Generic File Access Functions
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Directory/File Access Permissions for COPY and Generic File Access Functions