X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D162AD1C4E1 for ; Tue, 5 Aug 2003 08:16:12 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 92514-04 for ; Tue, 5 Aug 2003 05:14:56 -0300 (ADT) Received: from mail2.tpgi.com.au (mail.tpgi.com.au [203.12.160.58]) by svr1.postgresql.org (Postfix) with ESMTP id E0798D1C4B7 for ; Tue, 5 Aug 2003 05:16:00 -0300 (ADT) Received: from 192.168.0.4 (220-244-72-6.tpgi.com.au [220.244.72.6]) by mail2.tpgi.com.au (8.12.9/8.12.9) with ESMTP id h758Fxpf006057 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 5 Aug 2003 18:16:00 +1000 From: "Alastair G. Hogge" To: pgsql-interfaces@postgresql.org Subject: Seeking PyGreSQL help Date: Tue, 5 Aug 2003 18:16:06 +1000 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308051816.06256.agh@tpg.com.au> X-Kaspersky-Antivirus: Passed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/14 X-Sequence-Number: 4368 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: #python >>>import _pg >>>db = _pg.connect("mydb", "myhost") Traceback (most recent call last): File "", 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? 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