Problem with self-join updates...

From: Benoit Menendez <benoitm(at)pacbell(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Problem with self-join updates...
Date: 2002-02-15 18:39:21
Message-ID: 002101c1b650$18f087a0$0201a8c0@osprey
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-02-15 18:51:03 Re: Problem with self-join updates...
Previous Message Tom Lane 2002-02-15 18:15:14 Re: create index on function - why?