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

From lrotger
Subject Re: update impossible, constraint prevents it but it shouldn't
Date
Msg-id 449FEE72.5080002@aircomp.aero
Whole thread Raw
In response to Re: update impossible, constraint prevents it but it shouldn't  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout wrote:
> 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.

it worked, I thought I had to specify the table being updated in the
from clause too if only to have something to join to the other table, as
it turns out, it's not necessary. I hope the manual for 8.1.x explains
this or at least gives some examples of using this nonstandard from clause.

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

I'll have to allocate some time to read changelogs before I upgrade
across major versions.

thanks a lot,
Lucia

pgsql-general by date:

Previous
From: "Francesco Formenti - TVBLOB S.r.l."
Date:
Subject: Re: unique attributes in profile management system
Next
From: "Joshua D. Drake"
Date:
Subject: Re: RAID + PostgreSQL?