Обсуждение: https call in PostgreSQL

Поиск
Список
Период
Сортировка

https call in PostgreSQL

От
Charlin Barak
Дата:
Hi,
In Oracle, we use the UTL_HTTP package to make a https call within the database. Is there an equivalent in PostgreSQL?

Thanks.


Re: https call in PostgreSQL

От
Mariel Cherkassky
Дата:
check out orafce extension https://github.com/orafce/orafce

2018-05-11 18:30 GMT+03:00 Charlin Barak <charlinbarak@gmail.com>:
Hi,
In Oracle, we use the UTL_HTTP package to make a https call within the database. Is there an equivalent in PostgreSQL?

Thanks.


Re: https call in PostgreSQL

От
bricklen
Дата:

On Fri, May 11, 2018 at 8:30 AM Charlin Barak <charlinbarak@gmail.com> wrote:
In Oracle, we use the UTL_HTTP package to make a https call within the database. Is there an equivalent in PostgreSQL?

The following might work for you:
 

Re: https call in PostgreSQL

От
"Nickerson, Jon (Analytics and Decision Support)"
Дата:

Howdy,


Take a look at this PG extension:


https://github.com/pramsey/pgsql-http 

Also, here is a tutorial for that same extension:


https://boundlessgeo.com/2012/04/http-for-postgresql/



Jon Nickerson
Data Analyst II
Analytics and Decision Support

434-582-2933




Liberty University | Training Champions for Christ since 1971




From: bricklen <bricklen@gmail.com>
Sent: Friday, May 11, 2018 1:18 PM
To: charlinbarak@gmail.com
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: https call in PostgreSQL
 

On Fri, May 11, 2018 at 8:30 AM Charlin Barak <charlinbarak@gmail.com> wrote:
In Oracle, we use the UTL_HTTP package to make a https call within the database. Is there an equivalent in PostgreSQL?

The following might work for you:
 

Re: https call in PostgreSQL

От
Tom Lane
Дата:
Charlin Barak <charlinbarak@gmail.com> writes:
> In Oracle, we use the UTL_HTTP package to make a https call within the
> database. Is there an equivalent in PostgreSQL?

What I'd suggest is using one of the untrusted PLs --- probably plperlu
or plpythonu --- and coding whatever you need in that language.  Once
you're into one of those languages you have access to all the library
packages that are installed for it on the server machine, so it shouldn't
take very much code.

            regards, tom lane


Re: https call in PostgreSQL

От
Aldo Sarmiento
Дата:
Is it acceptable practice to make http calls from DB in most cases? I'm assuming if the http service becomes unavailable it could clog up all connections in pg.

I would think adding jobs to some sort of a worker would be a good solution for most applications.

Aldo Sarmiento


On Fri, May 11, 2018 at 11:25 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Charlin Barak <charlinbarak@gmail.com> writes:
> In Oracle, we use the UTL_HTTP package to make a https call within the
> database. Is there an equivalent in PostgreSQL?

What I'd suggest is using one of the untrusted PLs --- probably plperlu
or plpythonu --- and coding whatever you need in that language.  Once
you're into one of those languages you have access to all the library
packages that are installed for it on the server machine, so it shouldn't
take very much code.

                        regards, tom lane


Re: https call in PostgreSQL

От
Tom Lane
Дата:
Aldo Sarmiento <aldo@bigpurpledot.com> writes:
> Is it acceptable practice to make http calls from DB in most cases?

Well, that's up to you to decide.  For instance, it's a good idea to think
hard about what happens if your transaction aborts after you've started
(or worse, completed) some external interaction.  But I assume the OP
has already worked out those problems in the context of his existing
Oracle application.

            regards, tom lane


Re: https call in PostgreSQL

От
Charlin Barak
Дата:
Thanks everyone for your help/suggestions!

On Fri, May 11, 2018 at 2:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Aldo Sarmiento <aldo@bigpurpledot.com> writes:
> Is it acceptable practice to make http calls from DB in most cases?

Well, that's up to you to decide.  For instance, it's a good idea to think
hard about what happens if your transaction aborts after you've started
(or worse, completed) some external interaction.  But I assume the OP
has already worked out those problems in the context of his existing
Oracle application.

                        regards, tom lane