Received: from mail44.fg.online.no (mail44-s.fg.online.no [148.122.161.44]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAP2Ajm59493 for ; Sat, 24 Nov 2001 21:10:45 -0500 (EST) (envelope-from trond@nordheim.no) Received: from geekpower.koko.net (ti221110a080-0132.bb.online.no [146.172.20.131]) by mail44.fg.online.no (8.9.3/8.9.3) with ESMTP id DAA14173 for ; Sun, 25 Nov 2001 03:10:47 +0100 (MET) Subject: Automaticly delete related data From: Trond Arve Nordheim To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/0.99.2 (Preview Release) Date: 25 Nov 2001 03:10:26 +0100 Message-Id: <1006654229.11145.8.camel@geekpower> Mime-Version: 1.0 X-Archive-Number: 200111/350 X-Sequence-Number: 5732 Hi! I'm developing a publishing system and are trying to create functions/triggers that automaticly wipes out related data to the data currently beeing deleted... For example, I have a table containing site objects (an article or whatever) where I have the following fields; int_objectid SERIAL NOT NULL, str_objecttitle VARCHAR(255) NOT NULL, ... ... Then, I have a table defining the content of that data; int_objectid INT(11) NOT NULL str_data TEXT NOT NULL, ... ... What I want to do is; When I delete a row from the first table, I want all rows with mathing int_objectid values in the second table to be deleted. I've been reading in a couple of online books and the PostgreSQL documentation all day without beeing able to make something of this... Can anyone give me a hint, or point me in the direction of some documentation that can help me out? Sincerly, Trond Arve Nordheim