Problem with pl/python procedure connecting to the internet

From: Igor Sosa Mayor <joseleopoldo1792(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Problem with pl/python procedure connecting to the internet
Date: 2015-08-21 05:30:35
Message-ID: 8737zdryx0.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I'm a beginner with pgsql and have the following problem. I have written
a pl/python procedure to query geolocations (with the library geopy). It
inserts them into a table. All this works perfectly.

The problem is the configuration with the network connections. I'm using
pgsql in a private laptop. In order to let the procedure get results
from the internet I had to put

listen_addresses = '*' (in postgresql.conf) and
host all all 0.0.0.0/0 trust (in pg_hba.conf)

I don't think this is a good solution. Moreover: it doesn't work in all
places (work, home, etc.), since I imagine it depends on the fact that
the port is open.

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?

Many thanks in advance.

Igor Sosa Mayor

--
:: Igor Sosa Mayor :: joseleopoldo1792(at)gmail(dot)com ::
:: GnuPG: 0x1C1E2890 :: http://www.gnupg.org/ ::
:: jabberid: rogorido :: ::

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2015-08-21 07:10:55 Re: Dangers of mislabelled immutable functions
Previous Message Aviel Buskila 2015-08-21 05:25:52 Re: repmgr won't update witness after failover