Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wi6Fy-0000v0-1f for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 08:06:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wi6Fw-00GhD2-2z for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 08:06:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wi6Fw-00GhCu-27 for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2026 08:06:45 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wi6Fu-00000000cOf-3La4 for pgsql-hackers@postgresql.org; Fri, 10 Jul 2026 08:06:45 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 0B360637706 for ; Fri, 10 Jul 2026 10:06:43 +0200 (CEST) Received: from s934.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id E9D47636AD4; Fri, 10 Jul 2026 10:06:42 +0200 (CEST) Received: from localhost (unknown [172.22.191.5]) by s934.loopia.se (Postfix) with ESMTP id E7989A3D60D; Fri, 10 Jul 2026 10:06:42 +0200 (CEST) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s471.loopia.se (amavis); dkim=pass (2048-bit key) header.d=proxel.se Received: from s934.loopia.se ([172.22.191.6]) by localhost (s471.loopia.se [172.22.190.35]) (amavis, port 10024) with LMTP id Q9nYWkONRbQ5; Fri, 10 Jul 2026 10:06:42 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 147.28.75.140 Received: from [192.168.0.186] (customer-147-28-75-140.stosn.net [147.28.75.140]) (Authenticated sender: andreas@proxel.se) by s934.loopia.se (Postfix) with ESMTPSA id 67EEC917F1D; Fri, 10 Jul 2026 10:06:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1783670802; bh=RYIdvmTAkajoVBfpD10DOtdmxFqzGA9wIpedoCdT6iA=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=bkZADtAN6YcbkVRi24xg+POkquoJxeH25f7IZEFNE32rdk/lvHG549J7phdUSw9+X D/Kqf+edtRhCNQ5jL7LqwADbf4WZNj1/aSI9os2E7xFMmOGp+8/VdwjHfAnvj4DRQz BqjomEdSBuRsrr5MY80zgMAiHmzPudVXTLlPFG8d/8LfptDvfCGiVxEaSYQ2Ve/EW/ zPCYVp6ua57MinRCnWW+4URovFC4QYNbTfRhsXkySu9U4wEfcTshDQMZocXvuBIN9o e/589ESToNNpIfKOJ6ePw0BAEdOjiftr1y7OfuAFp/UvkxtJTXM2Rhv+Yr3TaHbJRD U6FTj3wa1maLw== Message-ID: <52c9a352-0e4a-4eaa-a9e1-06fd33cf562f@proxel.se> Date: Fri, 10 Jul 2026 10:06:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Proposal: INSERT ... BY NAME To: Jim Jones , Ayush Tiwari , PostgreSQL Hackers Cc: Peter Eisentraut References: Content-Language: en-US From: Andreas Karlsson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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