Re: Getting binary data out of a postgre database

2005-06-28 Thread projecktzero
whew! tempFile.write(str(rec[0])) works! printing rec[0].__class__ puts out pyPgSQL.PgSQL.PgBytea Thanks for the help! -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting binary data out of a postgre database

2005-06-27 Thread Diez B. Roggisch
projecktzero wrote: > Sorry for the late reply. I didn't check the group/list over the > weekend. > > Anyway, I added a print rec[0] just after the fetchone. Then I ran it > from the command line, and it spewed a bunch of binary gibberish nearly > locking up Putty. > > To me, it seems like it's c

Re: Getting binary data out of a postgre database

2005-06-27 Thread projecktzero
Sorry for the late reply. I didn't check the group/list over the weekend. Anyway, I added a print rec[0] just after the fetchone. Then I ran it from the command line, and it spewed a bunch of binary gibberish nearly locking up Putty. To me, it seems like it's coming out in the right format, but I

Re: Getting binary data out of a postgre database

2005-06-24 Thread Diez B. Roggisch
> So, rec[0] is an instance, but an instance of what? Since I needed to > use the PgSQL.PgBytea method on the image before inserting it into the > database, do I need to use a similar method to undo what PgBytea did to > it, or am I incorrectly writing this binary data? I tried > PgSQL.PgUnQuoteByt

Getting binary data out of a postgre database

2005-06-24 Thread projecktzero
Well, I've managed to get an image into a postgre database, but now I'm having trouble getting it out. #! /usr/bin/env python from pyPgSQL import PgSQL def main(): connectdb = PgSQL.connect('server:port:database:username:password') cur = connectdb.cursor() sqlStatement = """SELECT im