Does PLV8 support making http calls to other servers?

左心房为你撑大大i 提交于 2020-01-14 14:17:59

问题


If I write a function for PostgreSql using PLV8, can I call an url with a get/post request from my PLV8 function?


回答1:


No, according to this page and my understanding of "trusted":

PL/v8 is a trusted procedural language that is safe to use, fast to run and easy to develop, powered by V8 JavaScript Engine.




回答2:


No, as explained by Milen; use an untrusted PL like PL/perlu, PL/pythonu, PL/javau, etc.

Doing this has the same problem as sending email from a trigger, in that unexpected issues like DNS configuration problems could leave all your database connections busy waiting on HTTP connection attempts so nothing else can get any work done.

Instead, use LISTEN and NOTIFY to wake an external helper script that uses a queue table to manage the requests, as explained in the answer linked above.



来源:https://stackoverflow.com/questions/12666148/does-plv8-support-making-http-calls-to-other-servers

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