PL/pgSQL HTTP Request

Started by Sathish Kumarover 7 years ago4 messagesgeneral
Jump to latest
#1Sathish Kumar
satcse88@gmail.com

Hi Team,

Do PL/pgSQL support to create a function to make HTTP request. We have a
requirement to send data to external server from Postgres DB using
HTTP/HTTPS Post Method.

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: Sathish Kumar (#1)
Re: PL/pgSQL HTTP Request

Hi

pá 7. 12. 2018 v 14:48 odesílatel Sathish Kumar <satcse88@gmail.com> napsal:

Hi Team,

Do PL/pgSQL support to create a function to make HTTP request. We have a
requirement to send data to external server from Postgres DB using
HTTP/HTTPS Post Method.

Surely It doesn't support it. You can use some untrusted language - but it
is not safe.

you can use https://github.com/pramsey/pgsql-http extension. It is much
better, but still it not good idea. Stored procedures are perfect for work
inside database. Communication with outer world is not good

a) outer world is not transactional
b) outer world is too slow.

This is task for application (communication) server.

Regards

Pavel

#3Sathish Kumar
satcse88@gmail.com
In reply to: Pavel Stehule (#2)
Re: PL/pgSQL HTTP Request

Hi Pavel,

We would like to use with Google Cloud Sql where third party extensions are
not supported.

On Fri, Dec 7, 2018, 9:55 PM Pavel Stehule <pavel.stehule@gmail.com wrote:

Show quoted text

Hi

pá 7. 12. 2018 v 14:48 odesílatel Sathish Kumar <satcse88@gmail.com>
napsal:

Hi Team,

Do PL/pgSQL support to create a function to make HTTP request. We have a
requirement to send data to external server from Postgres DB using
HTTP/HTTPS Post Method.

Surely It doesn't support it. You can use some untrusted language - but it
is not safe.

you can use https://github.com/pramsey/pgsql-http extension. It is much
better, but still it not good idea. Stored procedures are perfect for work
inside database. Communication with outer world is not good

a) outer world is not transactional
b) outer world is too slow.

This is task for application (communication) server.

Regards

Pavel

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Sathish Kumar (#3)
Re: PL/pgSQL HTTP Request

pá 7. 12. 2018 v 14:58 odesílatel Sathish Kumar <satcse88@gmail.com> napsal:

Hi Pavel,

We would like to use with Google Cloud Sql where third party extensions
are not supported.

Then it easy - you cannot to do from Postgres.

Pavel

Show quoted text

On Fri, Dec 7, 2018, 9:55 PM Pavel Stehule <pavel.stehule@gmail.com wrote:

Hi

pá 7. 12. 2018 v 14:48 odesílatel Sathish Kumar <satcse88@gmail.com>
napsal:

Hi Team,

Do PL/pgSQL support to create a function to make HTTP request. We have a
requirement to send data to external server from Postgres DB using
HTTP/HTTPS Post Method.

Surely It doesn't support it. You can use some untrusted language - but
it is not safe.

you can use https://github.com/pramsey/pgsql-http extension. It is much
better, but still it not good idea. Stored procedures are perfect for work
inside database. Communication with outer world is not good

a) outer world is not transactional
b) outer world is too slow.

This is task for application (communication) server.

Regards

Pavel