Results 1 to 6 of 6

Thread: Qt Sql large BLOB

  1. #1
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt Sql large BLOB

    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

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Qt Sql large BLOB

    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.

  3. The following user says thank you to jefftee for this useful post:

    Ieshir (2nd July 2015)

  4. #3
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Sql large BLOB

    Maybe there's another way? For example, as background downloading (FTP, TCP, etc)

  5. #4
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Qt Sql large BLOB

    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?

  6. The following user says thank you to jefftee for this useful post:

    Ieshir (3rd July 2015)

  7. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt Sql large BLOB

    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.

  8. The following user says thank you to ChrisW67 for this useful post:

    Ieshir (3rd July 2015)

  9. #6
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Sql large BLOB

    Thank u



    close please

Similar Threads

  1. QSqlQuery Insert BLOB, But Not all the BLOB Is Inserted?
    By zerokewl in forum Qt Programming
    Replies: 0
    Last Post: 10th September 2013, 07:06
  2. QODBC on BLOB
    By baray98 in forum Qt Programming
    Replies: 0
    Last Post: 6th November 2009, 23:26
  3. Save PDF to BLOB
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2009, 06:47
  4. how to open a BLOB
    By aekilic in forum Qt Programming
    Replies: 0
    Last Post: 25th October 2008, 20:51
  5. Sending large datagrams(very large)
    By marcel in forum General Programming
    Replies: 1
    Last Post: 16th February 2008, 21:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.