|
From: Dave S. <Dst...@em...> - 2002-06-13 02:22:46
|
I tried to to this, and the "from" command worked, and I got a lot
further. But, as you can see from below, it wasn't 100% sucsessful. Any
clues as to what is going wrong? I made a pg_hba.conf in the PgSQL
directory, and added in my 10.0.0.120 address (that's my workstation),
but it didn't help.
Any clues?
========================================
>>> dsn = "dbname='xamime' user='root' host='10.0.0.21'"
>>> db = PgSQL.connect(dsn)
Traceback (most recent call last):
File "<pyshell#17>", line 1, in ?
db = PgSQL.connect(dsn)
File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 1591, in
connect
return Connection(connInfo)
File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 1689, in
__init__
raise DatabaseError, m
DatabaseError: FATAL 1: No pg_hba.conf entry for host 10.0.0.120, user
root, database root
>>> Michael Watkins <wa...@tr...> 06/12/02 09:43PM >>>
Close...
from pyPgSQL import PgSQL
dsn = 'dbname=yourdb user=youruser host=yourhost'
db = PgSQL.connect(dsn)
cursor = db.cursor()
and now...
cursor.execute("select * from something")
result = cursor.fetchall()
for row in result:
print row.acolumn, row.anothercolumn
happy experimenting...
Mike
At 09:30 PM 6/12/2002 -0400, Dave Strickler wrote:
>You're gonna think I'm whacko, but actually, I have read those docs.
What
>I'm missing, is what do I load ( I think its "import PgSQL") so that I
can
>use the connect command etc.
>
>When I start up Python, it doesn't understand any of the pypgsql
commands,
>and I assume that's b/c I need to load a library...
_______________________________________________________________
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
Pypgsql-users mailing list
Pyp...@li...
https://lists.sourceforge.net/lists/listinfo/pypgsql-users
|