Christoph Zwerschke wrote: >> So here is another strategy: flush the stream before going >> into postgres, then obtain the fileno() of the stream, and >> fdopen it with postgres' iostreams library. That might also >> be tricky to implement, but could work. > > > I understand what you mean. But the Postgres dll provides no means to > fdopen a new stream.
Right. So you must do so in the pygresql module. That means you have to get hold of msvcrt.dll's (sic) fdopen implementation. One way to do so would be through linking pygresql to msvcrt.dll, instead of linking it to msvcr71.dll. That should be only done if it is certain that there won't be any other resource sharing with Python (no malloc, no locale, no stdio - see "some" mskb article for the precise list of restrictions). I would expect that no such resource sharing happens, but one would have to verify the code to be certain. The other option is to use GetProcAddress to obtain the address of fdopen. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list