mil*_*lad 2 postgresql database-trigger
我将在 postgresql 中表的特定列的更新之前/之后创建一个触发器,但我不能这样做。
我可以在更新特定表的特定列后绑定触发器以触发,但我不能对多个列执行此操作。我想知道这可能吗?
我不想在我的触发器函数中使用 IF(UPDATE(column series)) 来解决它
--我试过下面的代码,但它给了我','附近的错误
create trigger save_information after update of table_name on day, month
for each row
execute procedure save_function();
Run Code Online (Sandbox Code Playgroud)
-- 但下面的代码(只提到一列)工作正常:
create trigger save_information after update of table_name on day
for each row
execute procedure save_function();
Run Code Online (Sandbox Code Playgroud)
我不想更改我的 save_function 来解决它或使用 'IF(update(column series)' 语句。请原谅我写得不好。
如手册中所述,列名列在OF关键字之后。
所以应该是:
create trigger save_information
after update of day, month
on table_name
for each row execute procedure save_function();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1304 次 |
| 最近记录: |