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.89) (envelope-from ) id 1ijogl-0004PQ-Rp for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Dec 2019 18:13:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ijogi-0004eZ-DX for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Dec 2019 18:13: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 1ijogi-0004eS-4w for pgsql-hackers@lists.postgresql.org; Tue, 24 Dec 2019 18:13:44 +0000 Received: from courriel.mines-paristech.fr ([77.158.173.149] helo=antispam-1.ensmp.fr) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ijoge-0007Z3-MH for pgsql-hackers@postgresql.org; Tue, 24 Dec 2019 18:13:43 +0000 Received: from smtp-5.mines-paristech.fr (smtp.mines-paristech.fr [77.158.173.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by antispam-1.ensmp.fr (antispam.mines-paristech.fr) with ESMTPS id 9C68A565A6; Tue, 24 Dec 2019 19:13:38 +0100 (CET) Received: from pc54.home (agrenoble-653-1-617-62.w92-129.abo.wanadoo.fr [92.129.165.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-5.mines-paristech.fr (Postfix) with ESMTPSA id 692E12005E; Tue, 24 Dec 2019 19:13:38 +0100 (CET) Date: Tue, 24 Dec 2019 19:13:32 +0100 (CET) From: Fabien COELHO X-X-Sender: fabien@pseudo To: Alvaro Herrera cc: Thomas Munro , Peter Eisentraut , pgsql-hackers Subject: Re: Allow an alias to be attached directly to a JOIN ... USING In-Reply-To: <20190917173742.GA8735@alvherre.pgsql> Message-ID: References: <20190917173742.GA8735@alvherre.pgsql> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddvvddgheejucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvufgjkfhffgggtgesthdtredttdervdenucfhrhhomhephfgrsghivghnucevqffgnffjqfcuoegtohgvlhhhohestghrihdrvghnshhmphdrfhhrqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeelvddruddvledrudeihedriedvnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 17 Sep 2019, Alvaro Herrera wrote: >> Indeed, that seems like a problem, and it's a good question. You can >> see this on unpatched master with SELECT x.filler FROM >> (pgbench_tellers AS t JOIN b USING (bid)) AS x. > > I'm not sure I understand why that problem is a blocker for this patch. As discussed on another thread, https://www.postgresql.org/message-id/flat/2aa57950-b1d7-e9b6-0770-fa592d565dda@2ndquadrant.com the patch does not conform to spec SQL:2016 Part 2 Foundation Section 7.10 Basically "x" is expected to include *ONLY* joined attributes with USING, i.e. above only x.bid should exists, and per-table aliases are expected to still work for other attributes. ISTM that this patch could be "returned with feedback". -- Fabien.