Run a shell script when a database record is written to postgres

前端 未结 2 1151
猫巷女王i
猫巷女王i 2021-01-07 03:46

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 befor

相关标签:
2条回答
  • 2021-01-07 04:21

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

    0 讨论(0)
  • 2021-01-07 04:24

    You can probably use rule or trigger and start your shell script for whatever PL that supports it, but I think the better way is to use it for sending notification and monitor it from a separate process.

    0 讨论(0)
提交回复
热议问题