Re: Proposal: INSERT ... BY NAME - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: Proposal: INSERT ... BY NAME
Date
Msg-id 52c9a352-0e4a-4eaa-a9e1-06fd33cf562f@proxel.se
Whole thread
In response to Re: Proposal: INSERT ... BY NAME  (Jim Jones <jim.jones@uni-muenster.de>)
Responses Re: Proposal: INSERT ... BY NAME
List pgsql-hackers
On 7/10/26 09:46, Jim Jones wrote:
> postgres=# CREATE TABLE t (a int, b int);
> CREATE TABLE
> postgres=# INSERT INTO t (a,b) BY NAME SELECT 37 AS b, 42 AS a;
> INSERT 0 1
> postgres=# SELECT * FROM t;
>   a  | b
> ----+----
>   42 | 37
> (1 row)
> 
> Since I don't have a copy of the SQL spec, I can't tell if this is a
> feature gap from DuckDB or if you just added this feature yourself. What
> does the spec say about it?

It is technically not yet in the standard but it was accepted and will 
almost certainly be there in the next version. I was there as a guest at 
the meeting when this very question was discussed and that is indeed a 
feature gap in DuckDB. But as it is a very new feature in the upcoming 
version of the standard that is to be expected.

According the accepted change proposal which was discussed when I was there:

INSERT INTO t (a,b) BY NAME SELECT 37 AS b, 42 AS a;

is effectively the same thing as:

INSERT INTO t (a,b) BY NAME SELECT a, b FROM (SELECT 37 AS b, 42 AS a);

-- 
Andreas Karlsson
Percona




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Possible typo in an error message
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: sequencesync worker race with REFRESH SEQUENCES