Re: VALUES ROW(...)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Markus Winand <markus(dot)winand(at)winand(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: VALUES ROW(...)
Date: 2020-01-28 21:00:35
Message-ID: 5884.1580245235@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Markus Winand <markus(dot)winand(at)winand(dot)at> writes:
> PostgreSQL does not accept the following standard conforming statement:
> VALUES ROW(1,2), ROW(3,4)
> There is a comment about this in the source code [0]:

> /*
> * We should allow ROW '(' expr_list ')' too, but that seems to require
> * making VALUES a fully reserved word, which will probably break more apps
> * than allowing the noise-word is worth.
> */

> The latest release of MySQL (8.0.19) introduced table value constructors (VALUES), but **requires** the keyword ROW [1]. Of the 9 systems I tested, only MySQL and H2 accept ROW in VALUES [2].

> Is it worth re-visiting this decision in order to improve standard conformance and MySQL (and H2) compability?

I'd still say that making VALUES fully reserved is a bridge too far:
you will make many more people unhappy from that than you make happy
because we can now spell this more than one way. (I'm somewhat
guessing that some people are using "values" as a column or table name,
but I doubt that that's an unreasonable guess.)

If you want to see some movement on this, look into whether we can
find a way to allow it without that. I don't recall exactly what
the stumbling block is there, but maybe there's a way around it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-01-28 21:06:17 Re: [PATCH] Windows port, fix some resources leaks
Previous Message Robert Haas 2020-01-28 20:59:53 Re: [PoC] Non-volatile WAL buffer