繁体   English   中英

Postgres避免在删除级联时触发

[英]Postgres avoid Trigger on delete cascade

你好,我有一个触发器的问题

我有2 张桌子

  • t_mandant
  • t_user_has_mandant

当我在t_user_has_mandant中 删除一行时,我在beforeDeleteUserMandant ()中调用触发器,但是当我从t_mandant中删除一个mandant时,我需要忽略触发器调用的可能性

因为t_user_has_mandantt_mandant 外键是在删除级联

我正在使用postgres 8.4

阅读this手册的this页。

使用变量

TG_TABLE_NAME

数据类型名称; 引起触发器调用的表的名称。

您可以确定DELETE是来自t_user_has_mandant还是t_mandant

暂无
暂无

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

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