PyQt4: Reading binary data from Postgresql fails under Windows
-
Hi and welcome to devnet,
It rather looks like your software doesn't find the PostgreSQL client libraries. Check with something like Dependency Walker
-
wrote on 28 Feb 2015, 05:58 last edited by
I can connect to Postgresql and execute other queries but that one has a problem.
-
Sorry, I've misunderstood your original problem. Saving a byte array in a file named something.pdf doesn't make it a valid pdf file. If you want to create a PDF you should create one using e.g. QPdfWriter
-
wrote on 1 Mar 2015, 08:20 last edited by
Ok, the file can be any file format in the database i.e. zip, pdf,doc,jpg etc. Is there any generic way to exctract from database and write to disk?
-
A text file works great
-
wrote on 2 Mar 2015, 05:59 last edited by
Thank you. I 'll check it. I have already checked a pdf and an xml
-
QFile doesn't know how to write pdf or xml just because you put that extension on the file name. It's your job to provide the right data.
-
wrote on 3 Mar 2015, 05:35 last edited by
Is that an OS specific issue? It works under Linux and not under Windows?
-
It's not OS nor Qt specific. A file extension doesn't do anything magic when writing programmatically to a file
-
wrote on 4 Mar 2015, 05:48 last edited by
How is it explained that the code works under Linux?
With the same code I can write pdf and zip.
Thanks for your patience!
11/11