From: | wieck(at)debis(dot)com (Jan Wieck) |
---|---|
To: | djackson(at)cpsgroup(dot)com (Jackson, DeJuan) |
Cc: | wieck(at)debis(dot)com, lockhart(at)alumni(dot)caltech(dot)edu, tgl(at)sss(dot)pgh(dot)pa(dot)us, hackers(at)postgreSQL(dot)org |
Subject: | Re: RI and PARSER (was: Re: [HACKERS] RI status report #1) |
Date: | 1999-09-29 17:25:32 |
Message-ID: | m11WNTw-0003kLC@orion.SAPserv.Hamburg.dsh.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>
> What does PENDANT imply/mean in terms of RI? I could figure out all of the
> other syntax.
As far as I understood it:
CREATE TABLE t1 (a1 integer PRIMARY KEY NOT NULL, b1 text);
CREATE TABLE t2 (a2 integer NOT NULL, b2 text,
CONSTRAINT check_a2
FOREIGN KEY (a2)
REFERENCES t1 (a1)
PENDANT
ON DELETE CASCADE
ON UPDATE CASCADE
INITIALLY DEFERRED);
This setup requires, that for each key in t1.a1 at least one
reference from t2.a2 MUST exist. So this is a cyclic
integrity check. I'm not sure if removing the last reference
automatically removes the PK row from t1 or if it raises an
error. Can someone clearify here?
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) #
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 1999-09-29 17:30:50 | Re: [HACKERS] RI status report #2 |
Previous Message | Bruce Momjian | 1999-09-29 17:21:48 | Re: [HACKERS] Re: TODO items |