Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does PLV8 support making http calls to other servers?

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

like image 771
mahonya Avatar asked Oct 27 '25 07:10

mahonya


2 Answers

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.

like image 93
Craig Ringer Avatar answered Oct 28 '25 19:10

Craig Ringer


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.

like image 21
Milen A. Radev Avatar answered Oct 28 '25 20:10

Milen A. Radev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!