View Full Version : Qt Sql large BLOB
Ieshir
2nd July 2015, 21:19
Hello
The database (PostgreSQL) stores large files (100 mb and above)
When I do a SELECT program crashes or freezes.
Tell me whether it is possible to download data parts or save them directly to a file (w/0 download 100 mb and above in memory when i do SELECT) in the background
jefftee
2nd July 2015, 22:37
If PostgreSQL has a substring function, you could grab parts in chunks and put them back together when you're retrieved all of the parts.
Ieshir
2nd July 2015, 23:04
Maybe there's another way? For example, as background downloading (FTP, TCP, etc)
jefftee
2nd July 2015, 23:11
Even with those other approaches, you still have to read 100MB+ objects from the database, which you said causes your program to hang. Can you elaborate on the hang, is it processing the first row of a select statement, after successfully retrieving a number of rows, etc?
ChrisW67
3rd July 2015, 00:03
The generic Sql interface in Qt will treat a blob column as a whole and return its content in a single QVariant(QByteArray). The average desktop machine should handle this For 100MB without issue, but an embedded or memory constrained machine could exhaust RAM. You could retrieve the content with a series of select statements each returning a substring() of the bytea column: clunky, but it might work. Other than that you could fall back on the Postgresql native API function lo_export() or the like.
Ieshir
3rd July 2015, 22:55
Thank u
close please
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.