Re: postgres connection problem via python pg DBI - Mailing list pgsql-general

From Dan Joo
Subject Re: postgres connection problem via python pg DBI
Date
Msg-id 4676DF8318F32F4AB7E98BCD9BC90628F3E162@agq-ex01.agraquest.int
Whole thread Raw
In response to postgres connection problem via python pg DBI  ("Dan Joo" <djoo@agraquest.com>)
List pgsql-general

Just solved it. 

 

For others, here is the solution. 

 

setsebool -P httpd_can_network_connect_db 1

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Dan Joo
Sent: Thursday, June 05, 2008 4:18 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] postgres connection problem via python pg DBI

 

Hi all,

 

I have a problem connecting to postgres via the python pg module ONLY from the cgi-scripts.

 

The command is:

 

db=pg.connect('aqdev','localhost',5432,None,None,'postgres',None)

 

From the commandline the connection works great, but from a cgi-script it barfs with the following message:

 

InternalError: could not create socket: Permission denied

 

Does anyone have any idea how I can get around this issue? 

 

Thanks a bunch!    

pgsql-general by date:

Previous
From: "Dan Joo"
Date:
Subject: postgres connection problem via python pg DBI
Next
From: Colin Wetherbee
Date:
Subject: Re: postgres connection problem via python pg DBI