Thread

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

    Jackson, DeJuan <djackson@cpsgroup.com> — 1999-09-29T16:31:58Z

    What does PENDANT imply/mean in terms of RI?  I could figure out all of the
    other syntax.
    
    > -----Original Message-----
    > From:	wieck@debis.com [SMTP:wieck@debis.com]
    > Sent:	Wednesday, September 29, 1999 9:03 AM
    > To:	lockhart@alumni.caltech.edu
    > Cc:	wieck@debis.com; tgl@sss.pgh.pa.us; hackers@postgreSQL.org
    > Subject:	Re: RI and PARSER (was: Re: [HACKERS] RI status report #1)
    > 
    > Thomas Lockhart wrote:
    > 
    > >
    > > > > >       CONSTRAINTS
    > > > > >       DEFERRABLE
    > > > > >       DEFERRED
    > > > > >       IMMEDIATE
    > > > > >       INITIALLY
    > > > > >       PENDANT
    > > > > >       RESTRICT
    > > >     O.K.  - I was able to add them all to ColId without conflicts
    > > >     for now.  Let's see what happens after adding the syntax  for
    > > >     CREATE CONSTRAINT TRIGGER.
    > >
    > > Right. Anything which causes trouble can be demoted to ColLabel.
    > >
    > > >     I'm  not  sure which of them are SQL92 or SQL3, at least they
    > > >     are all SQL3 "reserved" words according to the SQL3 draft.
    > >
    > > According to my Date and Darwen (which is mostly SQL92), all of these
    > > except "PENDANT" are SQL92 reserved words. PENDANT is not mentioned,
    > > so is presumably an SQL3-ism.
    > >
    > > Do you want me to update syntax.sgml?
    > 
    >     Please  be so kind. CREATE CONSTRAINT TRIGGER did not mess up
    >     anything, so all these new reserved words appear in ColId and
    >     are still available.
    > 
    > 
    > 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) #
    > 
    > 
    > 
    > ************
    
    
  2. Re: RI and PARSER (was: Re: [HACKERS] RI status report #1)

    Jan Wieck <wieck@debis.com> — 1999-09-29T17:25:32Z

    >
    > 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) #