Anyone know a good Pygresql Tutorial for Interfacing between Python &Postgresql
John fabiani
jfabiani at yolo.com
Wed Jun 16 09:58:24 EDT 2004
Peter Maas wrote:
> Chuck Amadi schrieb:
>
>> Anyone know a good Pygresql Tutorial for Interfacing between Python &
>> Postgresql .
>
>
> Tried Google and found
>
> http://www.pygresql.org/README.txt
>
>
> Mit freundlichen Gruessen,
>
> Peter Maas
>
I'm a newbie so take what I have to say with a grain of salt. The
problem for me was not how to make a connection to postgres but how to
use the data returned. Maybe I'm missing something but almost every
sample I could find did not work as expected. The first issue was each
example (ones found via google and in O'Reilly books) show that a tuple
is returned. At least for my postgres driver (module) the return type
is a list. The next issue is how to loop through the data. Also the
examples use fetchone() as an example. But even they did not work
because of the 'tuple' issue and most of the time I needed
fetchmany(100) or fetchall(). I still have not resolved most of the
issues but I'm still learning.
John
More information about the Python-list
mailing list