Re: Problem with pl/python procedure connecting to the internet

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Igor Sosa Mayor <joseleopoldo1792(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with pl/python procedure connecting to the internet
Date: 2015-08-22 13:51:49
Message-ID: 55D87E75.4040907@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/22/2015 12:23 AM, Igor Sosa Mayor wrote:
> Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
>
>> Does the code work reliably outside Postgres?
>> It seems you are reliant on the availability of the OpenStreetMap
>> service and its ability to provide a timely response.
>>
>> So what exactly is the trigger event, INSERT, UPDATE, both?
>>
>> Is it absolutely necessary that this happen in a trigger?
>
> yes, it works reliable. I can also add a timeout option, but it does not
> make any difference.
>
> As for the trigger: well, I don't know. I wanted to be triggered every
> time I add a city in the table 'ciudad'.postgres deals

Aargh, I was not paying attention.

Is the function you show here:

http://pastie.org/10366558

the actual function you are using in the trigger?

If so, there is no mechanism for getting the location coordinates into
the table, if that is what you want.

If that is not what you want, then what is the function supposed to do?

If it is not the trigger function, what is the actual function?

>
> Somehow I have the impression postgres is trying to make a connection
> without having to rights to get the answer (I'm on linux). I dont
> understand exactly which process (and with which rights) is executing
> the plpython procedure...
>
> Thanks in any case for your answer.
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2015-08-22 15:15:07 PostgreSQL Developer Best Practices
Previous Message Rich Schaaf 2015-08-22 11:28:55 Re: Problem with database connections timing out for long-running queries