Re: update impossible, constraint prevents it but it shouldn't - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: update impossible, constraint prevents it but it shouldn't
Date
Msg-id 20060626124946.GD24611@svana.org
Whole thread Raw
In response to update impossible, constraint prevents it but it shouldn't  (lrotger <lrotger@aircomp.aero>)
Responses Re: update impossible, constraint prevents it but it shouldn't  (lrotger <lrotger@aircomp.aero>)
List pgsql-general
On Mon, Jun 26, 2006 at 01:00:19PM +0200, lrotger wrote:
> I run the following query:
>
> update personal set closed_date = flt_date + 20
> from enr inner join personal p on enr.id = p.id_enr
> where (...columns from enr, columns from personal...)

I think your problem is that "personal" and "personal p" refer to
different instances of the same table. Use EXPLAIN to check how many
times "personal" appears in the resulting query.

Oh yeah, 7.2 will eat your data eventually, you have been warned.
Please upgrade to something newer.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Return the primary key of a newly inserted row?
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Return the primary key of a newly inserted row?