Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1JJ6pE62569 for ; Tue, 19 Feb 2002 14:06:51 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g1JJ6kS06779; Tue, 19 Feb 2002 14:06:46 -0500 (EST) To: Benoit Menendez cc: pgsql-sql@postgresql.org Subject: Re: Problem with self-join updates... In-reply-to: <002b01c1b973$bf48c740$0201a8c0@osprey> References: <002101c1b650$18f087a0$0201a8c0@osprey> <002b01c1b973$bf48c740$0201a8c0@osprey> Comments: In-reply-to Benoit Menendez message dated "Tue, 19 Feb 2002 10:32:06 -0800" Date: Tue, 19 Feb 2002 14:06:46 -0500 Message-ID: <6776.1014145606@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200202/240 X-Sequence-Number: 6664 Benoit Menendez writes: > I have the following self-join update: > update TABLE set PARENT_ID=parent.PARENT_ID > from TABLE, TABLE parent > where TABLE.PARENT_ID=parent.ID > and parent.ID in (1,2,3,4) > Table name "table" specified more than once Wasn't this answered already? You should not have the "from TABLE" in there. Essentially, there's already an implicit FROM entry for the target table, you don't need another. "from TABLE parent" is sufficient here. regards, tom lane