How can I send some http request from postgresql f

2020-02-01 03:44发布

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

3条回答
再贱就再见
2楼-- · 2020-02-01 03:53

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

查看更多
太酷不给撩
3楼-- · 2020-02-01 04:02

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.

查看更多
我命由我不由天
4楼-- · 2020-02-01 04:12

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

pgsql-http

查看更多
登录 后发表回答