Re: Update violating constraint

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Naz Gassiep <naz(at)mira(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Update violating constraint
Date: 2007-05-03 15:02:38
Message-ID: 4639F98E.4080105@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton wrote:
> Alban Hertroys wrote:
>> Naz Gassiep wrote:
>>> Hi,
>>> I'm trying to do an update on a table that has a unique constraint
>>> on the field, I need to update the table by setting field = field+1
>
>> I think you're looking for deferrable constraints; see:
>>
>> http://www.postgresql.org/docs/8.2/static/sql-set-constraints.html
>
> Which won't work with unique constraints unfortunately. That's because
> they're implemented through a unique index.

I appreciate the complexities involved, but that really ought to work on
a single statement. I recall seeing something along these lines on the
TODO list some time ago?

--
Alban Hertroys
alban(at)magproductions(dot)nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede

// Integrate Your World //

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Tilles 2007-05-03 15:11:26 Re: psql access of user's environmental variables
Previous Message Thorsten Kraus 2007-05-03 14:59:59 Stored procedure