Re: INSERT .. SET syntax - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: INSERT .. SET syntax
Date
Msg-id bbad30aa-1d2b-b533-3442-4a6c5af26694@2ndquadrant.fr
Whole thread Raw
In response to Re: INSERT .. SET syntax  (Marko Tiikkaja <marko@joh.to>)
List pgsql-hackers
On 08/31/2016 04:12 PM, Marko Tiikkaja wrote:
> Hello hello,
> 
> Here's a rebased and updated patch for $SUBJECT for the September commit
> fest.

Review:

This patch is pretty straightforward, using mostly already existing
infrastructure.  I tried to break it in various ways and could not.  I
do have a few comments, though.

In insert.sgml, some things are <replaceable class="parameter"> and some
are <replaceable class="PARAMETER">.  I don't expect this patch to fix
those inconsistencies, but it should certainly not perpetuate them.

This code comment in gram.y took me a while to figure out:

+/*
+ * This is different from set_clause_list used in UPDATE because the
SelectStmt
+ * syntax already does everything you might want to do in an in INSERT.
+ */

If the SelectStmt is all we need, why is this patch here?  I would
prefer wording such as "This is different from set_clause_list used in
UPDATE because we don't want multiple_set_clause.  The INSERT INTO ...
SELECT variant may be more appropriate in such cases."  Or something.

Aside from those trivialities, the main question about this patch is if
we actually want it.  It is not standard SQL syntax, and the only other
product I've located that uses it (or anything like it) is MySQL.
However, I can see how it would be a huge win for very wide tables and
so my personal opinion is to accept this syntax as a PostgreSQL
extension to the standard.

Marking ready for committer, the minor gripes above notwithstanding.
-- 
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: LSN as a recovery target
Next
From: Tom Lane
Date:
Subject: Re: [sqlsmith] Failed assertion in numeric aggregate