Re: Multicolumn foreign keys need useless unique indices? - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Multicolumn foreign keys need useless unique indices?
Date
Msg-id 1031936389.13531.34.camel@taru.tm.ee
Whole thread Raw
In response to Re: Multicolumn foreign keys need useless unique indices?  (Rod Taylor <rbt@rbt.ca>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: TOAST docs
Next
From: Joe Conway
Date:
Subject: Re: TOAST docs