开发者

How can I send some http request from postgresql function or trigger

开发者 https://www.devze.com 2023-01-08 12:17 出处:网络
I need to send data 开发者_如何学Pythonvia http protocol (GET or POST request) from the function or trigger.

I need to send data 开发者_如何学Pythonvia http protocol (GET or POST request) from the function or trigger. Is it possible?


You could try writing the trigger in PL/Python and use urllib2 to POST.


There is an extension to do this, use with caution.

pgsql-http


Any "untrusted" language with HTTP support can do this:

  • PL/Pythonu
  • PL/perlu
  • PL/javau
  • ...

but you shouldn't really do it. See Does PLV8 support making http calls to other servers? and why you shouldn't send email from a trigger function.

0

精彩评论

暂无评论...
验证码 换一张
取 消