Comment 1985 added to page dml-update.html of version 7.4

From: nobody <nobody(at)developer(dot)pgadmin(dot)org>
To: pgsql-www(at)postgresql(dot)org
Subject: Comment 1985 added to page dml-update.html of version 7.4
Date: 2005-01-12 10:02:20
Message-ID: 200501121002.j0CA2KwR025085@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

Author: puco <puco(at)atlas(dot)sk>
----
It looks like that Postgresql is checking for integrity and consistency during the update and not only after the end of update.

For example a have a table with a unique index on row Rank, that has 3 rows with values (0,1,2). When I want to execute this statement:

update
RankTable
set
Rank=(case when Rank=2 then 0 else Rank+1 end)

The table is inconsistent in the middle of update but when the update ends the table is again consistent. I understand that this should be correct and also passes in Microsoft SQL Server. Is there a possibility to force PostgresSQL to execute this statement without an error saying that I'm violating a constraint with duplicate key.
----
Manual page: http://wwwmaster.postgresql.org/docs/7.4/interactive/dml-update.html
Reject: http://wwwmaster.postgresql.org/admin/comments.php?action=reject&id=1985
Edit: http://wwwmaster.postgresql.org/admin/comment-edit.php?id=1985
Delete: http://wwwmaster.postgresql.org/admin/comments.php?action=delete&id=1985

Browse pgsql-www by date

  From Date Subject
Next Message nobody 2005-01-12 11:18:32 News entry 272 was approved by devrim
Previous Message Dave Page 2005-01-12 09:10:33 Re: font size