Re: update impossible, constraint prevents it but it shouldn't

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: lrotger <lrotger(at)aircomp(dot)aero>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: update impossible, constraint prevents it but it shouldn't
Date: 2006-06-26 12:49:46
Message-ID: 20060626124946.GD24611@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-06-26 13:00:28 Re: Return the primary key of a newly inserted row?
Previous Message nik600 2006-06-26 11:59:43 inheritance and table