[Tutor] Questions on pgDB connection

Ms Soo Chong s4046441 at student.uq.edu.au
Mon Aug 16 09:06:37 CEST 2004


Hi all,

I have problem connecting using pgdb module.

I read this webpage: 1)
http://www.linuxjournal.com/article.php?sid=2605 and
2) http://www/python.org/peps/pep-0249.html.

>From these websites I knew that I have to first
import the pgdb module then connect but the problem
is I don't know what is the connection word to
connect to the pgdb/server. Anybody know what I'm
talking about? I might sound stupid but I really not
sure about the connection stuffs and I have tried
lots of method but it just doesn't work for me.

The first webpage stated that if you are using the
SOLID version, the UNIX pipes are the only method
available to connect to the server. So what is the
method to connect the server if I'm using pgdb?

The second webpage stated that a connect should look
like this:

e.g. connect(dsn='myhost:MYDB', user='guido',
password='234$')

and it also stated that other than dsn, the other
stuffs such as user and passwd are optional, is it true?

my script looks like this:

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

I really appreciate if someone out there can give me
some help.

Thank you in advance.

Cheers
Shufen



 



More information about the Tutor mailing list