Received: from srasys.co.in ([202.54.63.129]) by postgresql.org (8.11.3/8.11.4) with SMTP id f775CK668373 for ; Tue, 7 Aug 2001 01:12:21 -0400 (EDT) (envelope-from sdn@srasys.co.in) Received: (qmail 27492 invoked from network); 7 Aug 2001 05:18:28 -0000 Received: from unknown (HELO MailWall) (172.16.0.108) by 0 with SMTP; 7 Aug 2001 05:18:28 -0000 Received: (qmail 27483 invoked from network); 7 Aug 2001 05:18:26 -0000 Received: from unknown (HELO sdn) (172.16.2.61) by 0 with SMTP; 7 Aug 2001 05:18:26 -0000 Message-ID: <027101c11eff$ffb48940$3d0210ac@arula> From: "Sundararajan" To: References: Subject: Delete Trigger Issue Date: Tue, 7 Aug 2001 10:45:39 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Archive-Number: 200108/87 X-Sequence-Number: 4308 I am developing a db application in postgresql and i need to write a delete trigger on one of the tables. the environment is table1 field1 varchar(64) other fields. table 2. field1 varchar(64) other fields I need a delete trigger on the table 1, so that if I delete a row from table 1 , the corresponding rows from table 2 should also be deleted. This is the code I have tried. DROP FUNCTION ApplicationsDeleteFn(); CREATE FUNCTION ApplicationsDeleteFn() RETURNS OPAQUE AS ' BEGIN delete from ports where appName=OLD.appName; RETURN OLD; END; ' LANGUAGE 'plpgsql'; Please help me with this, as my work is time bound.Even if the trigger is written is SQL Thanks sundar