Hannu Krosing wrote:
> Don Baccus wrote:
>
> > donb=# update foo set i=i+1;
> > ERROR: Cannot insert a duplicate key into unique index foo_pkey
>
> IIRC, the same behaviour plagued the old foreign key implementation
> in contrib, which was why it was refused for a long time to be
> integrated.
>
> I hope that at least the foreig keys don't do it anymore.
ALL the FK triggers are delayed until after the entire statement (what's wrong for ON DELETE RESTRICT -
but that's another story), or until the entire transaction (in deferred mode).
But the UNIQUE constraint is still built upon unique nbtree indices, thus failing on primary key where such
aunique index is automatically created for.
I'm far too less familiar with our implementation of nbtree to tell whether it would be possible at all to
delayunique checking until statement end or XACT commit. At least I assume it would require some similar
techniqueof deferred queue.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck@debis.com (Jan Wieck) #