将数据库记录写入Postgres时运行Shell脚本 [英] Run a shell script when a database record is written to postgres

查看:221
本文介绍了将数据库记录写入Postgres时运行Shell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

postgres中是否有某种机制可以在写入数据库记录时触发shell脚本?我可以编写脚本来仅监视数据库和表,但是在此之前,我想确保没有更好的方法。

Is there some mechanism in postgres that can fire off a shell script when a database record is written? I can write a script to just monitor the database and table but before doing that I wanted to make sure there wasn't a "better" way.

推荐答案

使用 PL / sh 编写触发函数。就是这样。

Write a trigger function using PL/sh. That's what it's for.

这篇关于将数据库记录写入Postgres时运行Shell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆