On Thu, Mar 22, 2018 at 1:15 AM, Peter Geoghegan <pg@bowt.ie> wrote:
> > > No, it did not. We only support VALUES clause with INSERT action.
But can't you have a subselect in the VALUES()? Support for subselects seems like a totally distinct thing to the restriction that only a (single row) VALUES() is allowed in INSERT actions.
Ah, right. That works even today.
postgres=# CREATE TABLE target (a int, b text);
CREATE TABLE
postgres=# MERGE INTO target USING (SELECT 1) s ON false WHEN NOT MATCHED THEN INSERT VALUES ((SELECT count(*) FROM pg_class), (SELECT relname FROM pg_class LIMIT 1));