Re: Trailing comma support in SELECT statements

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Trailing comma support in SELECT statements
Дата
Msg-id 20141003162027.GD14522@momjian.us
обсуждение исходный текст
Ответ на Trailing comma support in SELECT statements  (Bogdan Pilch <bogdan@matfyz.cz>)
Ответы Re: Trailing comma support in SELECT statements
Список pgsql-hackers
On Sun, Sep 28, 2014 at 01:42:46PM +0200, Bogdan Pilch wrote:
> Hi,
> I have created a small patch to postgres source (in particular the
> psql part of it) that accepts trailing comma at the end of list in
> SELECT statement.
> 
> The idea is to be able to say both (with the same result):
> SELECT a, b, c from t;
> SELECT a, b, c, from t;
> 
> Attached you can find a patch containing regression test (incorporated
> into the serial_schedule).
> My patch is relative to origin/REL9_4_STABLE branch as that is the one
> I started from.
> 
> My plea is to have this change merged into the main stream so that it
> becomes available in upcoming releases.
> 
> This modification does not require any interaction with user.
> It does not create any backward compatibility issues.

Interesting --- I know some languages allow trailing delimiters, like
Perl and Javascript.  Could this mask query errors?  Does any other
database accept this?  Seems this would need to be done in many other
places, like UPDATE, but let's first decide if we want this.

FYI, it is usually better to discuss a feature before showing a patch.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Trailing comma support in SELECT statements
Следующее
От: Claudio Freire
Дата:
Сообщение: Re: [RFC] Incremental backup v2: add backup profile to base backup