X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 14211475843 for ; Tue, 18 Feb 2003 10:50:22 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 6799247580B for ; Tue, 18 Feb 2003 10:50:21 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1IFoP5u023771; Tue, 18 Feb 2003 10:50:25 -0500 (EST) To: Bruno Wolff III Cc: Christoph Haller , pgsql-sql@postgresql.org Subject: Re: " Adding missing FROM-clause entry for table .... " problem. In-reply-to: <20030218141243.GA11505@wolff.to> References: <3E521E3F.C5E4251B@rodos.fzk.de> <20030218141243.GA11505@wolff.to> Comments: In-reply-to Bruno Wolff III message dated "Tue, 18 Feb 2003 08:12:43 -0600" Date: Tue, 18 Feb 2003 10:50:25 -0500 Message-ID: <23770.1045583425@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/401 X-Sequence-Number: 11799 Bruno Wolff III writes: > Christoph Haller wrote: >> AFAIK, statements like >> DELETE FROM t1 where t1.id = t2.id ; >> are legal. Could the parser still work on this, if the feature is >> removed? > Only if a new syntax is added. For UPDATE, we actually do have an extension syntax that allows naming secondary tables explicitly: UPDATE target SET ... FROM other-tables WHERE ... The trouble with extending this to DELETE is that DELETE already uses the keyword FROM. Seems like we are stuck with a choice between DELETE FROM target FROM other-tables WHERE ... DELETE FROM target, other-tables WHERE ... both of which are bizarre and confusing to my eyes. I think that MySQL uses the second form, which I like even less than the first (it obscures the very fundamental semantic difference between the deletion target and the other tables). Or we could go off with a different keyword, perhaps DELETE FROM target WITH other-tables WHERE ... but that doesn't seem to pass the low-astonishment test either. Comments? It would not be difficult to implement any of these alternatives. okay, you think it's so easy, *you* decide what color it should be regards, tom lane