pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alastair G. Hogge <agh@tpg.com.au>
To: pgsql-interfaces@postgresql.org
Subject: Seeking PyGreSQL help
Date: Tue, 5 Aug 2003 18:16:06 +1000
Message-ID: <200308051816.06256.agh@tpg.com.au> (raw)

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




view thread (9+ messages)  latest in thread

Message-ID: <200308051816.06256.agh@tpg.com.au>
Permalink:  ../200308051816.06256.agh@tpg.com.au/
Also on:    postgresql.org/message-id/200308051816.06256.agh@tpg.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: agh@tpg.com.au
  Subject: Re: Seeking PyGreSQL help
  In-Reply-To: <200308051816.06256.agh@tpg.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox