Calling rest service from postgresql functions and stored proc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling rest service from postgresql functions and stored proc

mahesh.sp
Hi,

Would like to know whether postgresql supports calling a rest service from function or stored procedure.

Looking for Oracle to postgresql feasibility study.

Searched in Google but could not find any official document regarding the same. Appreciate if inputs or reference links are shared or confirmed.


Thanks,
Mahesh
Reply | Threaded
Open this post in threaded view
|

Re: Calling rest service from postgresql functions and stored proc

Magnus Hagander-2
On Thu, Feb 7, 2019 at 10:53 AM mahesh.sp <[hidden email]> wrote:
Hi,

Would like to know whether postgresql supports calling a rest service from function or stored procedure.

Looking for Oracle to postgresql feasibility study.

Searched in Google but could not find any official document regarding the same. Appreciate if inputs or reference links are shared or confirmed.


Absolutely. Pick any language capable of doing it (e.g. python, perl, v8/js etc) and it will work fine. Depending on what the rest api looks like it might also be a good idea to use something like multicorn to create a foreign data wrapper to access it, thereby not needing a function or procedure at all.
 
--
Reply | Threaded
Open this post in threaded view
|

Re: Calling rest service from postgresql functions and stored proc

Pavel Stehule
In reply to this post by mahesh.sp
Hi

čt 7. 2. 2019 v 10:53 odesílatel mahesh.sp <[hidden email]> napsal:
Hi,

Would like to know whether postgresql supports calling a rest service from function or stored procedure.

Looking for Oracle to postgresql feasibility study.

Searched in Google but could not find any official document regarding the same. Appreciate if inputs or reference links are shared or confirmed.

you can do simply via untrusted languages or you can use this extension  https://github.com/pramsey/pgsql-http (better).

or don't do it. Usually it is not great idea (sometimes there can be a exceptions)

Regards

Pavel




Thanks,
Mahesh