Re: Allowing additional commas between columns, and at the end of the SELECT clause

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Cc: Artur Formella <artur(dot)formella3(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allowing additional commas between columns, and at the end of the SELECT clause
Date: 2024-05-13 12:28:19
Message-ID: 87bk59hp5o.fsf@wibble.ilmari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> writes:

> On Mon, 13 May 2024 at 10:42, Artur Formella <artur(dot)formella3(at)gmail(dot)com> wrote:
>> Motivation:
>> Commas of this type are allowed in many programming languages, in some
>> it is even recommended to use them at the ends of lists or objects.
>
> Single trailing commas are a feature that's more and more common in
> languages, yes, but arbitrary excess commas is new to me. Could you
> provide some examples of popular languages which have that, as I can't
> think of any.

The only one I can think of is Perl, which I'm not sure counts as
popular any more. JavaScript allows consecutive commas in array
literals, but they're not no-ops, they create empty array slots:

❯ js
Welcome to Node.js v18.19.0.
Type ".help" for more information.
> [1,,2,,]
[ 1, <1 empty item>, 2, <1 empty item> ]

- ilmari

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2024-05-13 12:31:41 WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts
Previous Message Hayato Kuroda (Fujitsu) 2024-05-13 12:28:11 RE: Slow catchup of 2PC (twophase) transactions on replica in LR