[Tutor] Questions on pgDB connection

Ms Soo Chong s4046441 at student.uq.edu.au
Mon Aug 16 15:43:24 CEST 2004


Hi,

Thanks for your prompt reply.

PostgreSQL is in the same machine as my python script.
Actually, I have already tried this method :

import pgdb
db = pgdb.connect(dsn='localhost:moncdata', user='username',
 password='None')

The error message showed something related to the password, 
stating that it is unknown. I'm not very sure about the 
exact error message, sorry, B'cos I'm currently not in the 
Uni, therefore, I can't check the message, but mayb I will 
take it down tomorrow and email python tutor again.

I'm not very sure about the problem too and when I got rid of 
passwd, it will show another error msg about the local host.

#moncdata is the name of the database, I'm currently working at.

I wonder if there is any useful script around using pgdb? Can
someone recommend me, I really need that.

Thank you in advance.

Cheers,
Shufen

----- Original Message -----
From: Kent Johnson <kent_johnson at skillsoft.com>
Date: Monday, August 16, 2004 11:18 pm
Subject: Re: [Tutor] Questions on pgDB connection

> Maybe you need the host name in your connection string. Are you 
> running 
> PostgreSQL on the same machine as your Python script? Then try
> import pgdb
> db = pgdb.connect(dsn='localhost:moncdata', user='username',
> password='None')
> 
> What error messages are you getting?
> 
> Good luck,
> Kent




More information about the Tutor mailing list