当前位置:网站首页>Gbase 8C trigger (II)
Gbase 8C trigger (II)
2022-07-03 02:22:00 【Dazhuang twelve】
The statement that locates the parent table in the inheritance or partition hierarchy will not cause the statement level trigger of the affected child table to be triggered ; Only the statement level trigger of the parent table is triggered . however , Row level triggers for any affected child tables will be triggered .
If one INSERT contain ON CONFLICT DO UPDATE Clause and references EXCLUDED Column , Possible row level BEFORE INSERT Triggers and row level BEFORE UPDATE The effect of the trigger may be in a way that The final state of the updated row is applied transparently . however , For the row level of the two sets to be executed BEFORE Triggers don't need to have EXCLUDED Column references . When there are row levels at the same time BEFORE INSERT and BEFORE UPDATE Trigger modification is inserted / When updating rows ( Even if the modification has more or less the same effect , But if they are not idempotent , There may be a problem with this ), Possible unexpected results should be considered . Note that ON CONFLICT DO UPDATE when , Whether there is a quilt or not UPDATE influence ( And whether or not other UPDATE route ), Sentence level UPDATE Will be executed . With a ON CONFLICT DO UPDATE Clause INSERT Statement level... Will be executed first BEFOREINSERT, Then execute statement level BEFOREUPDATE trigger , Then there is the statement level AFTERUPDATE trigger , Finally, the statement level AFTERINSERT trigger .
Trigger functions called by statement level triggers should always return NULL. According to the selection of row level trigger , The trigger function called by it can return a table row ( type HeapTuple A value of ) Give the actuator . Row level triggers triggered before an operation have the following options :
- It can return to NULL To skip the operation on the current line . This instructs the actuator not to perform row level operations that invoke triggers ( Insertion of a specific table row 、 Modify or delete ).
- Row level only INSERT and UPDATE The trigger says , The returned row is called the row to be inserted or replaces the row to be updated . This allows the trigger function to modify the row to be inserted or updated .
A row level that unintentionally leads to any of these behaviors BEFORE The trigger must be careful about its result , Make it the same as the incoming line ( namely ,INSERT and UPDATE Trigger NEW That's ok ,DELETE Trigger OLD That's ok ).
A row level INSTEAD OF Triggers can return NULL To indicate that it has not modified any data from the underlying base table of the view , You can also return the passed in view row (INSERT and UPDATE Operation of the NEW That's ok , perhaps DELETE Operation of the OLD That's ok ). A non empty return value is used to mark that the trigger has performed the necessary data modification in the view . This will cause the count of lines modified by the command to be increased . about INSERT and UPDATE operation , The trigger may return NEW Modify the row before . This will change INSERT RETURNING or UPDATE RETURNING Returned data , And useful when the view cannot correctly display the same data provided to it .
For row level triggers triggered after an operation , The return value is ignored , So they can return NULL.
If more than one trigger is defined for the same event on the same relationship , They will be triggered in alphabetical order of their names . stay BEFORE and INSTEAD OF In the case of a trigger , The potentially modified row returned by each trigger becomes the input of the next trigger . If any one BEFORE or INSTEAD OF Trigger returns NULL, This operation will be disabled on this row and no subsequent triggers will be triggered for this row .
边栏推荐
- Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)
- Gbase 8C system table PG_ cast
- The Sandbox阐释对元宇宙平台的愿景
- Tongda OA homepage portal workbench
- GBase 8c系统表-pg_aggregate
- Method of removing webpage scroll bar and inner and outer margins
- 缺少库while loading shared libraries: libisl.so.15: cannot open shared object file: No such file
- MySQL learning 03
- Gbase 8C system table PG_ class
- GBase 8c 创建用户/角色 示例二
猜你喜欢
4. 类和对象
内存池(内核角度理解new开辟空间的过程)
通达OA v12流程中心
詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信
How do it students find short-term internships? Which is better, short-term internship or long-term internship?
Use go language to realize try{}catch{}finally
oauth2.0鉴权,登录访问 “/oauth/token”,请求头Authorization(basicToken)如何取值???
y54.第三章 Kubernetes从入门到精通 -- ingress(二七)
SPI mechanism
Distributed transaction solution
随机推荐
Kotlin middle process understanding and Practice (II)
awk从入门到入土(0)awk概述
Gbase 8C system table PG_ database
创建+注册 子应用_定义路由,全局路由与子路由
GBase 8c系统表-pg_constraint
GBase 8c系统表-pg_class
单词单词单词
Oauth2.0 authentication, login and access "/oauth/token", how to get the value of request header authorization (basictoken)???
使用Go语言实现try{}catch{}finally
Stm32f407 ------- IIC communication protocol
Javescript 0.1 + 0.2 = = 0.3 problem
Startup mode and scope builder of collaboration in kotlin
stm32F407-------DMA
GBase 8c系统表pg_cast
Deep learning notes (constantly updating...)
stm32F407-------ADC
通达OA 首页门户工作台
Iptables layer 4 forwarding
Use go language to realize try{}catch{}finally
es6 filter() 数组过滤方法总结