Delete Trigger Issue

From: "Sundararajan" <sdn(at)srasys(dot)co(dot)in>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Delete Trigger Issue
Date: 2001-08-07 05:15:39
Message-ID: 027101c11eff$ffb48940$3d0210ac@arula
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Robby Slaughter 2001-08-07 05:28:28 RE: Delete Trigger Issue
Previous Message Grant 2001-08-07 04:42:45 Re: Delete coloumn