Re: [HACKERS] Re: ALTER TABLE DROP COLUMN

From: wieck(at)debis(dot)com (Jan Wieck)
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: Don Baccus <dhogaza(at)pacifier(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: ALTER TABLE DROP COLUMN
Date: 2000-02-29 00:43:17
Message-ID: m12Pakv-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 a unique
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 delay unique
checking until statement end or XACT commit. At least I
assume it would require some similar technique of deferred
queue.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-02-29 00:45:02 Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)
Previous Message Don Baccus 2000-02-29 00:36:07 Re: [HACKERS] Re: ALTER TABLE DROP COLUMN