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.94.2) (envelope-from ) id 1s9BxM-000Ox1-6z for pgsql-novice@arkaria.postgresql.org; Mon, 20 May 2024 22:58:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s9BxK-005qnI-82 for pgsql-novice@arkaria.postgresql.org; Mon, 20 May 2024 22:58:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9BxJ-005qnA-Vf for pgsql-novice@lists.postgresql.org; Mon, 20 May 2024 22:58:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9BxH-001CRA-HB for pgsql-novice@lists.postgresql.org; Mon, 20 May 2024 22:58:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 44KMw5T13697381; Mon, 20 May 2024 18:58:05 -0400 From: Tom Lane To: Matthew Mellon cc: pgsql-novice@lists.postgresql.org Subject: Re: INSERT ... SELECT nonpositional syntax In-reply-to: References: Comments: In-reply-to Matthew Mellon message dated "Mon, 20 May 2024 17:56:47 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3697379.1716245885.1@sss.pgh.pa.us> Date: Mon, 20 May 2024 18:58:05 -0400 Message-ID: <3697380.1716245885@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthew Mellon writes: > SAP's products have a nice feature not found in the ANSI standards for the > INSERT ... SELECT syntax: WITH AUTO NAME. Assume you have a table that > looks something like this: > ... > INSERT INTO TableX > WITH AUTO NAME > SELECT a i, > b j, > c k > FROM TableY; > I'm not complaining here, but just wondering if there is a way that the > syntax can be extended at this level using an extension, or if there is a > fighting chance of extending the syntax in the base product? I recall that we've discussed having some way to do this; but not with that particular syntax. If memory serves, the last proposal looked more like UPDATE ... SET, that is INSERT INTO TableX SET i = a, j = b, k = c FROM TableY; The general consensus though seems to be that we don't want to get out front of the SQL standards committee on something like this. If we do, for sure they'll standardize some other way to do the same thing :-( regards, tom lane