Re: Trailing comma support in SELECT statements

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: Trailing comma support in SELECT statements
Дата
Msg-id 1413520499323-5823365.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Trailing comma support in SELECT statements  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: Trailing comma support in SELECT statements
Список pgsql-hackers
Jim Nasby-5 wrote
> On 10/3/14, 4:02 PM, David G Johnston wrote:
>> Should we also allow:
>>
>> SELECT
>> , col1
>> , col2
>> , col3
>> FROM ...
>>
>> ?
> I would say yes, if we're going to do this. I don't see it being any worse
> than trailing commas.
> 
> If we are going to do this, we need to do it EVERYWHERE.
> 
> FWIW, the way I normally "work around" this problem is:
> 
> SELECT
>      blah
>      , foo
>      , bar
>      , baz
> 
> In my experience, it's quite uncommon to mess with the first item in the
> list, which mostly eliminates the issue. A missing leading comma is also
> MUCH easier to spot than a missing trailing comma.
> 
> 
> -- 
> Sent via pgsql-hackers mailing list (

> pgsql-hackers@

> )
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers


Jim Nasby-5 wrote
> On 10/3/14, 4:02 PM, David G Johnston wrote:
>> Should we also allow:
>>
>> SELECT
>> , col1
>> , col2
>> , col3
>> FROM ...
>>
>> ?
> I would say yes, if we're going to do this. I don't see it being any worse
> than trailing commas.
> 
> If we are going to do this, we need to do it EVERYWHERE.
> 
> FWIW, the way I normally "work around" this problem is:
> 
> SELECT
>      blah
>      , foo
>      , bar
>      , baz
> 
> In my experience, it's quite uncommon to mess with the first item in the
> list, which mostly eliminates the issue. A missing leading comma is also
> MUCH easier to spot than a missing trailing comma.

We might as well allow a final trailing (or initial leading) comma on a
values list at the same time:

VALUES
(...),
(...),
(...),
;


David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Trailing-comma-support-in-SELECT-statements-tp5821613p5823365.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Superuser connect during smart shutdown
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Trailing comma support in SELECT statements