Received: from druid.net (root@druid.net [216.126.72.98]) by hub.org (8.10.1/8.10.1) with ESMTP id e73E5nG37254 for ; Thu, 3 Aug 2000 10:05:50 -0400 (EDT) Received: from localhost (1668 bytes) by druid.net via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) (ident using unix) id for ; Thu, 3 Aug 2000 10:05:50 -0400 (EDT) (Smail-3.2.0.109 1999-Oct-27 #3 built 2000-Jun-28) Message-Id: From: darcy@druid.net (D'Arcy J.M. Cain) Subject: Re: Python + PostgreSQL In-Reply-To: <4.1.20000802123207.00c22a20@pop3.bemarnet.es> "from Antonio Navarro Navarro at Aug 2, 2000 12:34:19 pm" To: Antonio Navarro Navarro Date: Thu, 3 Aug 2000 10:05:50 -0400 (EDT) CC: pgsql-interfaces@hub.org Reply-To: pgsql-interfaces@hub.org X-Mailer: ELM [version 2.4ME+ PL78 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200008/37 Thus spake Antonio Navarro Navarro > I have installed postgresql-python-7.0.2-2.i386.rpm in a RedHat 6.2 box. > Where can I find documentation for this module ? I'm trying to connect to a > server but the python says 'no password supplied' > > import pg > > dg = pg.connect("template1", "localhost", 5432) If the server requires a password then you need to supply one here. If you don't need a password (i.e. "psql template1" works) then try this. import pg dg = pg.DB("template1") Note DB is preferred over connect but the main change is not to use localhost to connect. The default is to use a Unix socket rather than TCP/IP to localhost and PostgreSQL treats that differently. If localhost was just used here for illustrative purposes and in fact you are connecting over TCP/IP to another machine then look at pg_hba.conf to adjust permissions or add a password to the connection call. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.