Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TXv1g-0008WC-8o for pgsql-bugs@postgresql.org; Mon, 12 Nov 2012 14:30:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TXv1a-0008J7-Qo for pgsql-bugs@postgresql.org; Mon, 12 Nov 2012 14:30:11 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qACEU4tM013180; Mon, 12 Nov 2012 09:30:05 -0500 (EST) From: Tom Lane To: stefano@sportilia.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7653: Minor problem with join condition In-reply-to: References: Comments: In-reply-to stefano@sportilia.com message dated "Mon, 12 Nov 2012 10:14:49 +0000" Date: Mon, 12 Nov 2012 09:30:03 -0500 Message-ID: <13179.1352730603@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201211/56 X-Sequence-Number: 34614 stefano@sportilia.com writes: > Don't know if this is a bug or a correct behaviour, but in a query like > this: > SELECT t1.* FROM > table1 t1 JOIN > table2 t2 ON t1.id = t2.t1id JOIN > table3 t3 ON t1.id = t2.t1id > The parser should return an error because we are joining a table without > using any of its column. There is no such restriction in the SQL standard. regards, tom lane