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

Поиск
Список
Период
Сортировка
От Igor Sosa Mayor
Тема Re: Problem with pl/python procedure connecting to the internet
Дата
Msg-id 87k2smc5ii.fsf@gmail.com
обсуждение исходный текст
Ответ на Problem with pl/python procedure connecting to the internet  (Igor Sosa Mayor <joseleopoldo1792@gmail.com>)
Список pgsql-general
"Charles Clavadetscher" <clavadetscher@swisspug.org> writes:

>> Yes, exactly the same code. Exactly the same query: two consoles, one with
>> postgres, other with ipython. Postgres gives the error; ipython works.
>
> Somehow I expected that answer. I am not a python expert, but it happens
> that different pieces of code at the end do not use the same libraries or
> framework code by configuration. But if you are positive on that, no more
> discussion.

Well, I put the same code... what exactly python does is another
question...

> Sorry for asking obvious things, but it happened to me to oversee some of
> them in the past: Are you making the calls from the same computer?

obvious things are often the most important ones. But: yes, this is all
the time my laptop. And I did not change the config of postgres since I
put the configurations I mentioned in my first email.

> So it looks like a timeout problem with a confusing error message.
> A possible way to follow this up would be to call another webservice from a
> python function in PG and see if it behaves the same.

I had the same idea... but a small script querying the IMDB database
works perfectly in the console, but gives an error in PG. THe error is
not so obvious like in the geocoder case, but in any case the movie data
are not loaded.

> Another way to analyze the problem could be to sniff the network traffic and
> see what really happens when you make the function call. This could help at
> least to discard network problems and may lead to some useful
> information.

GOod idea. I see wireshark changed a lot since the last time I used
it... if I'm using it the right way, the thing is pointing in the
direction I thought: there is NO CONNECTION from PG to the internet when
I use the function. I dont see any packages. From the python console
there is a connection to nominatim (openstreetmap).

I think there is exactly the problem: PG does not make any attempt (or
it does but it fails even before any package is being sent) to the
internet.

THnaks for your ideas and help.


--
:: Igor Sosa Mayor     :: joseleopoldo1792@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/      ::
:: jabberid: rogorido  ::                            ::

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Problem with pl/python procedure connecting to the internet
Следующее
От: Igor Sosa Mayor
Дата:
Сообщение: Re: Problem with pl/python procedure connecting to the internet