Skip site navigation (1) Skip section navigation (2)

Seeking PyGreSQL help

From: "Alastair G(dot) Hogge" <agh(at)tpg(dot)com(dot)au>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Seeking PyGreSQL help
Date: 2003-08-05 08:16:06
Message-ID: 200308051816.06256.agh@tpg.com.au (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hello,

I'm running PostgreSQL-7.3.3_1 on FreeBSD 5.0-CURRENT. I'm trying to use 
python to interface with my database. I'm using Python-2.3 and 
py23-PyGreSQL-7.3.3_1 from the FreeBSD ports tree.

My problem is when I try to connect to the database.
Following is how the problem occurs:
<error>
#python
>>>import _pg
>>>db = _pg.connect("mydb", "myhost")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
_pg.error: could not connect to server: Connection refused
        Is the server running on host myhost and accepting
        TCP/IP connections on port 5432?
</erro>

I know my database is working because when I load it up with psql all appears 
ok. I can even add and retrive information.

I'm only just starting out in Python and PostgreSQL so any help would be much 
appreciated.

Thanks in advance
-Al


Responses

pgsql-interfaces by date

Next:From: D'Arcy J.M. CainDate: 2003-08-05 09:10:39
Subject: Re: Seeking PyGreSQL help
Previous:From: Frank van VugtDate: 2003-08-05 07:13:40
Subject: Fwd: Re: Multi-threaded user app segfaults when using libpq with separate connections

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group