当前位置:网站首页>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 .
边栏推荐
- GBase 8c 函数/存储过程参数(二)
- Javescript 0.1 + 0.2 = = 0.3 problem
- 簡單理解svg
- 微服务组件Sentinel (Hystrix)详细分析
- 面试项目技术栈总结
- Deep learning notes (constantly updating...)
- easyExcel
- Missing library while loading shared libraries: libisl so. 15: cannot open shared object file: No such file
- awk从入门到入土(1)awk初次会面
- How to deal with cache hot key in redis
猜你喜欢
![[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数](/img/06/ab333a4752de27eae2dd937cf579e2.png)
[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数

PyTorch 卷积网络正则化 DropBlock

Distributed transaction solution

easyExcel

Memory pool (understand the process of new developing space from the perspective of kernel)

Machine learning notes (constantly updating...)

Create + register sub apps_ Define routes, global routes and sub routes
![[shutter] shutter debugging (debugging fallback function | debug method of viewing variables in debugging | console information)](/img/66/0fda43da0d36fc0c9277ca86ece252.jpg)
[shutter] shutter debugging (debugging fallback function | debug method of viewing variables in debugging | console information)

y54.第三章 Kubernetes从入门到精通 -- ingress(二七)

Deep learning notes (constantly updating...)
随机推荐
GBase 8c系统表-pg_authid
Return a tree structure data
Gbase 8C system table PG_ collation
JS的装箱和拆箱
单词单词单词
Cfdiv2 Fixed Point Guessing - (2 points for Interval answer)
Socket编程
4. 类和对象
Leetcode 183 Customers who never order (2022.07.02)
Iptables layer 4 forwarding
stm32F407-------DMA
Producer consumer model based on thread pool (including blocking queue)
Coroutinecontext in kotlin
【教程】chrome關閉跨域策略cors、samesite,跨域帶上cookie
Detailed introduction to the usage of Nacos configuration center
使用Go语言实现try{}catch{}finally
GBase 8c系统表-pg_amop
awk从入门到入土(0)awk概述
My creation anniversary
Socket programming