Trailing comma support in SELECT statements

From: Bogdan Pilch <bogdan(at)matfyz(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Trailing comma support in SELECT statements
Date: 2014-09-28 11:42:46
Message-ID: 20140928114246.GA22150@artax.karlin.mff.cuni.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.
Not does it have any performance impact.

regards
bogdan

Attachment Content-Type Size
0001-trailing_comma_support.patch text/x-diff 3.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bogdan Pilch 2014-09-28 11:49:51 Time measurement format - more human readable
Previous Message Andreas Karlsson 2014-09-28 11:25:09 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}