Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1FIdCE50428 for ; Fri, 15 Feb 2002 13:39:12 -0500 (EST) (envelope-from benoitm@pacbell.net) Received: from osprey ([209.232.53.45]) by mta6.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GRL00JQI7TBOU@mta6.snfc21.pbi.net> for pgsql-sql@postgresql.org; Fri, 15 Feb 2002 10:39:12 -0800 (PST) Date: Fri, 15 Feb 2002 10:39:21 -0800 From: Benoit Menendez Subject: Problem with self-join updates... To: pgsql-sql@postgresql.org Message-id: <002101c1b650$18f087a0$0201a8c0@osprey> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Mailer: Microsoft Outlook Express 6.00.2600.0000 Content-type: multipart/alternative; boundary="Boundary_(ID_gAYc62TbrPRigepRZsxuvQ)" X-Priority: 3 X-MSMail-priority: Normal X-Archive-Number: 200202/187 X-Sequence-Number: 6613 This is a multi-part message in MIME format. --Boundary_(ID_gAYc62TbrPRigepRZsxuvQ) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT 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) This query is use to update a hierarchy before deleting specific records... I get the following error: Table name "table" specified more than once This appears to be a limitation of the update syntax which is not documented... Is this something that will be fixed soon? or should I write this query differently? Any suggestions? Thanks for your help. Benoit --Boundary_(ID_gAYc62TbrPRigepRZsxuvQ) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
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)
This query is use to update a hierarchy before deleting specific records...
 
I get the following error:
 
    Table name "table" specified more than once
 
This appears to be a limitation of the update syntax which is not documented...
 
Is this something that will be fixed soon? or should I write this query differently?
 
Any suggestions?
 
Thanks for your help.
 
    Benoit
--Boundary_(ID_gAYc62TbrPRigepRZsxuvQ)--