Looking for some help with cascading updates... - Mailing list pgsql-sql

From Mark True
Subject Looking for some help with cascading updates...
Date
Msg-id 647d31c20604181119m43ba3c7ay3d467dd9446a6fd8@mail.gmail.com
Whole thread Raw
Responses Re: Looking for some help with cascading updates...  (Andreas Kretschmer <akretschmer@spamfence.net>)
List pgsql-sql
<br />Here is the question:<br /><br />I have a situation where I need to create triggers to cascade an insert
operationto many tables to maintain foreign key constraints.  <br /><br />So at a high level<br /><br />INSERT INTO
myTable(Name, Address, Zip) VALUES ('Mark', '3 Dingle St.', '01832') <br /><br />myTable has a relation to two other
tables,which contain Zip and Address.  Before I insert into  myTable I want to:<br /><br />Check if '3 Dingle St.'
existsin table Address, if not insert it<br />Check if '01832' exists in table Zip and if not insert it <br /><br />I
wantto generalize this so that for any insert into myTable, I guarantee that if Zip and Address are not populated they
willbe.  My insert into myTable always contains full information required for doing the inserts into the other related
tables.<br /><br />Help?<br /><br />--Mark<br /><br /> 

pgsql-sql by date:

Previous
From: Markus Schaber
Date:
Subject: Migrating a Database to a new tablespace
Next
From: Andreas Kretschmer
Date:
Subject: Re: Looking for some help with cascading updates...