Re: Delete Trigger Issue
От | Stephan Szabo |
---|---|
Тема | Re: Delete Trigger Issue |
Дата | |
Msg-id | Pine.BSF.4.21.0108062232420.32102-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Delete Trigger Issue ("Sundararajan" <sdn@srasys.co.in>) |
Список | pgsql-sql |
On Tue, 7 Aug 2001, Sundararajan wrote: > I am developing a db application in postgresql and i need to write a delete > trigger on one of the tables. > > 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. Well, if you want the other semantics (not allow rows in 2 that don't match rows in 1, etc) you could use a foreign key rather than an explicit trigger. > > 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'; Are you actually making the trigger? What does it do when you try to make the trigger and then when you try to delete?
В списке pgsql-sql по дате отправления: