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

From: lrotger <lrotger(at)aircomp(dot)aero>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: update impossible, constraint prevents it but it shouldn't
Date: 2006-06-26 14:25:54
Message-ID: 449FEE72.5080002@aircomp.aero
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2006-06-26 14:51:16 Re: RAID + PostgreSQL?
Previous Message Francesco Formenti - TVBLOB S.r.l. 2006-06-26 14:03:11 Re: unique attributes in profile management system