Skip site navigation (1) Skip section navigation (2)

unfortunately...

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: hackers(at)postgreSQL(dot)org
Cc: darcy(at)druid(dot)net
Subject: unfortunately...
Date: 1998-09-25 03:53:02
Message-ID: 360B139E.FA1587FC@krs.ru (view raw or flat)
Thread:
Lists: pgsql-hackers
I don't like implementation of referential integrity constraints 
in contrib/spi/refint.* and implementation of ... unique indices:
backend checks constraints when tuple is changed.

Oracle checks constraints after entire _statement_ is done.
Do you remember this:

vac=> create table x (a int unique);
NOTICE:  CREATE TABLE/UNIQUE will create implicit index x_a_key for table x
CREATE
vac=> insert into x values (1);
INSERT 143852 1
vac=> insert into x values (2);
INSERT 143853 1
vac=> update x set a = a + 1;
ERROR:  Cannot insert a duplicate key into a unique index

This is simplest case. Keeping in mind triggers
I would like to see Oracle behaviour some day and so
I decided to do not implement FOREIGN keys in 6.4 -:((

Sorry.

Vadim

Responses

pgsql-hackers by date

Next:From: Thomas G. LockhartDate: 1998-09-25 04:50:08
Subject: Re: [HACKERS] unfortunately...
Previous:From: Bruce MomjianDate: 1998-09-25 03:38:40
Subject: Re: [HACKERS] pg_dump, problem with user defined types?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group