Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ow7p6-0005Ri-G5 for pgsql-general@arkaria.postgresql.org; Fri, 18 Nov 2022 20:18:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ow7p5-0002Li-Af for pgsql-general@arkaria.postgresql.org; Fri, 18 Nov 2022 20:18:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ow7p4-0002LZ-Vq for pgsql-general@lists.postgresql.org; Fri, 18 Nov 2022 20:18:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ow7p0-0005om-IE for pgsql-general@postgresql.org; Fri, 18 Nov 2022 20:18:49 +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 2AIKIiMN2262040; Fri, 18 Nov 2022 15:18:44 -0500 From: Tom Lane To: Nikhil Benesch cc: pgsql-general@postgresql.org Subject: Re: Appetite for `SELECT ... EXCLUDE`? In-reply-to: References: Comments: In-reply-to Nikhil Benesch message dated "Fri, 18 Nov 2022 15:01:18 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2262038.1668802724.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 18 Nov 2022 15:18:44 -0500 Message-ID: <2262039.1668802724@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nikhil Benesch writes: > Both DuckDB and Snowflake, as of recently, support a nonstandard `EXCLUD= E` > clause in the SELECT list to allow excluding fields from a wildcard [0] = [1]. > Example from the DuckDB announcement [2]: > SELECT * EXCLUDE (jar_jar_binks, midichlorians) FROM star_wars > Is there any appetite for adding this feature to PostgreSQL? This has been discussed before and not gone anywhere, e.g. [1] [2]. I think there have been more threads but that was all I found in a quick archive search. Anyway, as those threads illustrate, there is a lot of room for variation in how you spell it, where you can write it, and so on. My own inclination is to not do anything here until/unless the SQL committee standardizes something, because there's too much risk of finding ourselves incompatible with the standard. regards, tom lane [1] https://www.postgresql.org/message-id/flat/d51371a2-f221-1cf3-4a7d-b22= 42d4dafdb%40gmail.com [2] https://www.postgresql.org/message-id/flat/CANcm6wbR3EG7t-G%3DTxy64Yt8= nR6YbpzFRuTewJQ%2BkCq%3DrZ8M2A%40mail.gmail.com