Re: Trailing comma support in SELECT statements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bogdan Pilch <bogdan(at)matfyz(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Trailing comma support in SELECT statements
Date: 2014-10-03 16:18:49
Message-ID: 24510.1412353129@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bogdan Pilch <bogdan(at)matfyz(dot)cz> writes:
> 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.

This doesn't seem to me to be a remarkably good idea. What's the
difference between this and accepting random misspellings of SELECT,
allowing mismatched parentheses in expressions, etc etc? It's important
in a computer language to be able to catch typos.

If we were going to be lax about trailing commas, the SELECT list
would hardly be the only candidate, or even the first candidate,
for being lax that way. But I don't want to go there.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-10-03 16:20:27 Re: Trailing comma support in SELECT statements
Previous Message Heikki Linnakangas 2014-10-03 16:14:14 Re: Last Commitfest patches waiting review