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.