Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6XpW-000224-6B for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 10:52:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6XpU-0008HA-U2 for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 10:52:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6XpU-0008H3-HX for pgsql-general@lists.postgresql.org; Tue, 25 Feb 2020 10:52:44 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j6XpR-0003WZ-5J for pgsql-general@postgresql.org; Tue, 25 Feb 2020 10:52:43 +0000 Received: by mail-wm1-x336.google.com with SMTP id t79so995450wmt.3 for ; Tue, 25 Feb 2020 02:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ocado.com; s=google; h=reply-to:subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=B6yRc86ObhuS8w5B5yRAfNTrqs0pr9/v3lnEX4+bevs=; b=Ub0Jayt4Gkg08bNQOa/C3ICZGzWAMR4CL6cmUHRab3Zyw9otauFiEbgH95K19qUuOW YPuYU01N0D/SZPH/+FgS6f4IcgNQ45pncXcn4Zv/YK2L9e5oS7sJ3Vp9fUDS0kwSxLLu MiEkvUzwsQs4HItl8B+IDXIaC1tqlKKuJiv0HdP8712rmkBegSfB/xeuPLrwr4ni4g3r T3z4GMSLFJbQkfPrp/xQHSUToXE81dQtjAOOkd1gYssijq6HAe8SsaPu7u2rRse7ijqm Od9LhP6PvvfPqjW7xgSaZ8Kj7hKQcmqyA/Q0/I2fUWwquo9dTE5Xu3vti+8gKBWtDat8 DJoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=B6yRc86ObhuS8w5B5yRAfNTrqs0pr9/v3lnEX4+bevs=; b=YDef3FbErPFUeFHA/th1SSQbYN2PAr52VTLwl9a1/YlXO/hNmzJLVnOEBdv11gjr+9 K82CVanjvbPR3GOMjtpIGtefU2wcPXRj8U0Zv4Z+bHMWZkPQpuV761AzfPW9nCbwLXLp xOzyg26ARJtC1/1pTIxs/ZrCcgX0Y55S0JScDETsYeMC4Ko9G98BhLXceZMeZDfEcJns 9iUNAu8ZcKNiZddxhT89xh8Ty7wUCnOUuwXvT/j2GrUKt7iJTMeUZYUlbo8R6d6TCy8k aQkIshI3J56Yo02BtZ5DUeesXuYZGaWnTxTq59gt+0BNi+yid2XSFZW0t3xHpsKhBuiU 96kA== X-Gm-Message-State: APjAAAWWs2+ETf3urQ4beU5SyTCPTdIYTF2mvt0kMwMF8yRyU/NamOL8 fEJwrSGQUZtjkZtMR46O4HwgSVXU3CeljqeAKSRuYdKTvT4rhvBwiAnK2YFmkd1JoGXEAZqhbGw wV5WtINHQskw2TkhdDLOiC6SzLJqGj6I+f9c/fcaRs3zn5Px3/yun8ZJwbH97T57IROL7sBRF7B qjHKgT X-Google-Smtp-Source: APXvYqyW187kqTT3IyIE0ViNDEHQLyHaXqzX0ihTVHaab+6Pd8OYu75cwDRdZBcl7rMlX2f14yDIMw== X-Received: by 2002:a05:600c:299:: with SMTP id 25mr4730196wmk.68.1582627958981; Tue, 25 Feb 2020 02:52:38 -0800 (PST) Received: from [10.62.12.18] ([91.206.1.124]) by smtp.gmail.com with ESMTPSA id 133sm4014424wmd.5.2020.02.25.02.52.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Feb 2020 02:52:38 -0800 (PST) Reply-To: f.venchiarutti@ocado.com Subject: Re: a proposal for a new functionality: "SELECT * [EXCEPT col1 [,col2]] To: =?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= , =?UTF-8?Q?Stanislav_Moty=c4=8dka?= Cc: "pgsql-general@postgresql.org >> PG-General Mailing List" References: From: Fabio Ugo Venchiarutti Organization: Ocado Technology Message-ID: <1d18c9e2-ce3f-05b8-5b6e-3b959c527dac@ocado.com> Date: Tue, 25 Feb 2020 10:52:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk That makes sense, however for my general use case I'd also like the=20 ability to mark some columns as not match-able by `SELECT * FROM=20 ` and `TABLE
` at table definition without having to=20 create dedicated views (think of the way system attributes such as=20 tableoid, cmax, cmin ... are handled) . Typical use case: manual inspection of rows containing an hefty payload=20 field and some metadata ones; the payload more often than not isn't the=20 bit I'm interested in, but the size of it dominates the output making it=20 hard to read (granted - psql has formatting options to handle that, but=20 having a sane default at the table level would help a lot). One may argue that such behaviour breaks the principle of least=20 surprise, so all of this should probably be strictly opt-in (and perhaps=20 queries could output some hints that such hidden columns exists). Regards F On 25/02/2020 10:30, Josef =C5=A0im=C3=A1nek wrote: > Just to mention, similar concept can be found in Google BigQuery. >=20 > https://cloud.google.com/bigquery/docs/reference/standard-sql/query-synta= x#select-except > https://cloud.google.com/bigquery/docs/reference/standard-sql/query-synta= x#select-replace >=20 > =C3=BAt 25. 2. 2020 v=C2=A011:18 odes=C3=ADlatel Stanislav Moty=C4=8Dka= =20 > > napsal= : >=20 > Hello, >=20 > Sometimes (for tables with many columns) it would be better and > easier to write "SELECT" statement with clause "EXCEPT": > "SELECT * [EXCEPT col1 [,col2]] FROM ..." >=20 > It's easier to write "except" one or two columns from all (*) as to > write names of all columns besides one or two. > What do you thin about it? >=20 > Best regards > Stano Motycka >=20 --=20 Regards Fabio Ugo Venchiarutti OSPCFC Network Engineering Dpt. Ocado Technology --=20 Notice:=20 This email is confidential and may contain copyright material of=20 members of the Ocado Group. Opinions and views expressed in this message=20 may not necessarily reflect the opinions and views of the members of the=20 Ocado Group. If you are not the intended recipient, please notify us=20 immediately and delete all copies of this message. Please note that it is= =20 your responsibility to scan this message for viruses. References to the=20 "Ocado Group" are to Ocado Group plc (registered in England and Wales with= =20 number 7098618) and its subsidiary undertakings (as that expression is=20 defined in the Companies Act 2006) from time to time. The registered office= =20 of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way,=20 Hatfield, Hertfordshire, AL10 9UL.