(fwd) Re: RI and PARSER (was: Re: [HACKERS] RI status report #1)

Andrey Gerzhov (kittle@freeland.kiev.ua)
Tue, 5 Oct 1999 18:38:14 +0300 (EEST)

-- forwarded message --
Path: freeland.kiev.ua!news.alexradio.kiev.ua!not-for-mail
Message-ID: <m11WNTw-0003kLC@orion.SAPserv.Hamburg.dsh.de>
From: wieck@debis.com (Jan Wieck)
Subject: Re: RI and PARSER (was: Re: [HACKERS] RI status report #1)
To: djackson@cpsgroup.com (Jackson, DeJuan)
Date: Wed, 29 Sep 1999 19:25:32 +0200 (MET DST)
Newsgroups: alex.gated.pgsql.hackers
Lines: 36
Xref: freeland.kiev.ua alex.gated.pgsql.hackers:10989

>
> 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@debis.com (Jan Wieck) #

************ -- end of forwarded message --

-- 
С тем, что не помешает никогда,
                                               Kittle