postgresql - 发生事情时调用过程
问题描述
我只想知道我是否可以在发生某些事情时自动调用一个过程。特别是,当 now() 时间戳超过记录的时间戳属性一个月时,我想调用一个从表中删除记录的函数。就像是
create or replace procedure eliminate_when_time_past()
as $$
begin
if (now() is one month past the record timestamp) then
delete from preñadas where hierro = ...
end if;
end;
$$
language plpgsql
可能吗?
解决方案
推荐阅读
- python - 如何在没有 tf-idf 的情况下创建组合?
- javascript - 对象是否有类似“.map”的函数?创建具有相同键的新对象
- react-native - 不支持的操作方法签名。必须返回 MPRemoteCommandHandlerStatus
- arduino - WeMos D1 Mini esptool.FatalError: Timed out waiting for packet header
- python-3.x - 在 GeoDataFrame.plot() 中正确重用 Axes
- amazon-redshift - 引用的 Redshift 上传错误:缺少换行符:意外字符 0x22
- android - 当我从我的 Android 设备中清除数据时,它会清除在我的 DB 助手的 onUpgrade 方法中创建的表
- android - 在屏幕底部显示评论输入和按钮 onClick
- arrays - 从输入文件填充数组
- javascript - 如何将信息(返回)从 php 发送到 javascript