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

前端 未结 3 1939
失恋的感觉
失恋的感觉 2020-12-06 09:53

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

相关标签:
3条回答
  • 2020-12-06 10:38

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

    0 讨论(0)
  • 2020-12-06 10:45

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

    pgsql-http

    0 讨论(0)
  • 2020-12-06 10:49

    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 讨论(0)
提交回复
热议问题