From: Karsten H. <Kar...@gm...> - 2003-01-13 11:10:21
|
> As a side not, not related to your problem, the previous 3 lines should be > written as: > cmd = "SELECT data FROM doc_obj WHERE oid=%s" > try: > cursor.execute(cmd, anObjID) True enough. I didn't audit the entire code base yet as we have supported other db-api drivers in the past. Mind you, we would still like to but db api 2.0 does not include Listen/Notify to the best of my knowledge and we need it. Apart from escaping in bytea and PgArray (the other reason we now focus in pypgsql) it shouldn't make much difference either? >> aFile.write(str(cursor.fetchone()[0])) > This will read all of data for anObjID into memory before writing it to the > file. It is possible that you are running out of memory on the Win9X platform. May be true. However, this same machine scanned the same picture just fine. > Is there a reason you didn't use large objects instead of bytea columns? With a) when I started out I found the interface awkward and couldn't get my brain wrapped around it b) it doesn't feel very natural c) bytea is supposed to become even more like lo_object in that it is supposed to gain chunk-read capabilities, too d) can one lo_import remotely ? this is crucial > large objects, you can read and write the data in 'chunks' to avoid consuming > large quantities of memory. I know, see c) above. > Does the problem also exist on Windows NT4, 2000 or XP? Don't have the chance to test as I don't have those platforms available. Apart from being an Open Source shop with limited funding we aren't even a shop at all... Just some insane MDs hacking Python :-) > This may be a Windows 98SE only problem. If it is, does Windows 98SE have to > be one of the supported platforms? Yes. > A work-around would be to use large objects and read/write the data in chunks > so as not to require such large buffers. I can, if requested, give some > sample code that will illustrate the methods to use. That would be very helpful. I may not be able to use it right away but it'll help me get a handle on it. Thanks ! Karsten Hilbert -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 |