如何在 postgresql 中创建 "trigger after update of a table on multiple column"?
how to create "trigger after update of a table on multiple column" in postgresql?
我打算在 postgresql 的 table 的特定列上创建一个触发器 before/after 更新,但我做不到。
我可以在更新特定 table 的特定列后将触发器绑定到触发,但我不能对多个列执行此操作。我想知道这可能吗?
我不想在我的触发函数中使用 IF(UPDATE(column series)) 来解决它
--我试过下面的代码,但它在','附近给我错误
create trigger save_information after update of table_name on day, month
for each row
execute procedure save_function();
-- 但下面的代码(仅提及一列)工作正常:
create trigger save_information after update of table_name on day
for each row
execute procedure save_function();
我不想更改我的 save_function 来解决它或使用 'IF(update(column series)' 语句。
文笔不好请见谅
As documented in the manual 列名称列在 OF
关键字之后。
所以应该是:
create trigger save_information
after update of day, month
on table_name
for each row execute procedure save_function();
我打算在 postgresql 的 table 的特定列上创建一个触发器 before/after 更新,但我做不到。
我可以在更新特定 table 的特定列后将触发器绑定到触发,但我不能对多个列执行此操作。我想知道这可能吗?
我不想在我的触发函数中使用 IF(UPDATE(column series)) 来解决它
--我试过下面的代码,但它在','附近给我错误
create trigger save_information after update of table_name on day, month
for each row
execute procedure save_function();
-- 但下面的代码(仅提及一列)工作正常:
create trigger save_information after update of table_name on day
for each row
execute procedure save_function();
我不想更改我的 save_function 来解决它或使用 'IF(update(column series)' 语句。 文笔不好请见谅
As documented in the manual 列名称列在 OF
关键字之后。
所以应该是:
create trigger save_information
after update of day, month
on table_name
for each row execute procedure save_function();