简体   繁体   English

删除触发后,功能

[英]After Delete trigger, Function

I have a trigger that looks like: 我有一个触发器,看起来像:

create trigger syncdataprodTrigger
after insert or update or delete on schema.table
for each row
execute procedure schema.schemaProdTableDataSync();

and a function that contains this snippet: 以及包含以下代码段的函数:

elseif (TG_OP = 'DELETE') then
delete from schema.table where id1 = old.id1;
RETURN NEW;

What I am expecting is that when a row is deleted from the first table it deletes it from the second table, but I am not getting this. 我期望的是,当从第一张表中删除一行时,它将从第二张表中删​​除它,但是我没有得到。 What am I doing wrong and what can I be doing differently? 我做错了什么,我可以做些什么?

使它起作用,结果是发生了derps,并且需要将触发器更改为正确的表格...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM