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
> however if this does not perform the updates on the table in a proper
> order (from last to first) then the update will cause a violation of the
> index *during* the update even though the table would be consistent
> after the update completes. So the update fails. How do I get around
> this without removing the constraint?
I think you're looking for deferrable constraints; see:
http://www.postgresql.org/docs/8.2/static/sql-set-constraints.html
--
Alban Hertroys
alban@magproductions.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 //