Re: Problem with pl/python procedure connecting to the internet - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Problem with pl/python procedure connecting to the internet
Date
Msg-id 55DC671C.9090908@aklaver.com
Whole thread Raw
In response to Re: Problem with pl/python procedure connecting to the internet  (Igor Sosa Mayor <joseleopoldo1792@gmail.com>)
List pgsql-general
On 08/25/2015 01:30 AM, Igor Sosa Mayor wrote:
> Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:
>
>> Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:
>>
>>> My question is therefore:
>>> 1. is there a way to permit the pl/python to connect to the internet all
>>>     the time and with a better configuration?
>>> 2. or should I forget the procedure and write a python script outside
>>>     the database?
>
> I'm again with the last update. The problem seems to be that for some
> reason PG does not realize that there is a network connection.
>
> More precisely:
> 1. I start the computer
> 2. PG starts and I can use it normally, EXCEPT from the plpython
>     procedure which does not connect

At this point can you connect to the Postgres server on your laptop from
another machine?

> 3. then I restart PG (with systemd) and it works. PG seems to "see" that
>     there is a connection.

Best guess, since this is a laptop, the network is not connected until
NetworkManager(or something similar) is active. On my laptop that
happens late in the startup sequence, after Postgres starts. This is
especially true if you are connecting to a wireless AP.

>
> Maybe it has something to do with systemd? I'm trying to get all debug
> information, but I can't see anything strange in the log. In order not
> to full the list with an attachment, I post the log here:
> http://pastie.org/10373991

FYI, include the time in your log prefix, it gives some idea of how far
apart the events are happening. Also logging NOTICE and above is a good
place to start. DEBUG buries you in mass of detail which may or may not
be relevant.

>
> Any ideas?
>
> Thanks in advance!
>
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Gavin Flower
Date:
Subject: Re: PostgreSQL Developer Best Practices
Next
From: Neil Tiffin
Date:
Subject: Re: PostgreSQL Developer Best Practices