Search Postgresql Archives

After delete trigger problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
 
I have a child table with
 
CONSTRAINT fkey FOREIGN KEY (x)  REFERENCES master (x) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE.
 
and
 
CREATE TRIGGER td_y  AFTER DELETE ON chlid  FOR EACH ROW EXECUTE PROCEDURE fn_td_y();
and this trigger refers to the master table...
 
CREATE OR REPLACE FUNCTION fn_td_y() RETURNS trigger AS
$BODY$
DECLARE
  fi integer;
BEGIN
    SELECT i INTO fi FROM master  WHERE x = old.x;
...
 
It seems that SELECT results to null, so the master has already deleted the row. Is this intended and how can I solve this?
 
Regards,
Teemu Juntunen
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux