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

拟墨画扇 提交于 2020-01-09 07:42:26

问题


I need to send data via http protocol (GET or POST request) from the function or trigger. Is it possible?


回答1:


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




回答2:


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

pgsql-http




回答3:


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.



来源:https://stackoverflow.com/questions/3325292/how-can-i-send-some-http-request-from-postgresql-function-or-trigger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!