Обсуждение: Comment 1985 added to page dml-update.html of version 7.4
Author: puco <puco@atlas.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
thisstatement:
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
thatthis should be correct and also passes in Microsoft SQL Server. Is there a possibility to force PostgresSQL to
executethis 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