On Fri, 2002-09-13 at 17:42, Rod Taylor wrote:
>
> > hannu=# update t set i=i+1;
> > ERROR: Cannot insert a duplicate key into unique index t_i_key
>
> A possibility may be to reverse the sequential scan order for the simple
> cases, but anything any more complex and the check should be deferred
> till end of statement, rather than checking immediately.
Or we could keep a 'conflict list' that would be dynamically added to
and deleted from during the statement and the statement would be aborted
if
1) there were any entries in the list at the end of statement
or
2) if the list overflowed at some predefined limit (say 1000 or 100.000
conflicts) during the statement.
in our simple case we would have at most 1 conflict in the list at any
time.
--------------
Hannu