From: darcy@druid.net
To: Antonio Navarro Navarro <hostmaster@bemarnet.es>
Cc: pgsql-interfaces@hub.org
Subject: Re: Python + PostgreSQL
Date: Thu, 3 Aug 2000 10:05:50 -0400 (EDT)
Message-ID: <m13KLd8-000AY3C@druid.net> (raw)
In-Reply-To: <4.1.20000802123207.00c22a20@pop3.bemarnet.es>
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 <darcy@{druid|vex}.net> | 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.
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: darcy@druid.net, hostmaster@bemarnet.es, pgsql-interfaces@hub.org
Subject: Re: Python + PostgreSQL
In-Reply-To: <m13KLd8-000AY3C@druid.net>
* 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