blob fields limit ? or record limit ?

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
carlonarcisi
Posts: 29
Joined: Fri 10 Dec 2010 15:07

blob fields limit ? or record limit ?

Post by carlonarcisi » Wed 05 Jan 2011 08:33

I have a table where I memorize the files. There is clearly a blob field where I store the file.
I read that the limit of postgres is 2gig byte blob field. I get an error "out of memory " on the POST command after adding the command:
TBlobField (PgAdd.FieldByName ('FileStream')). LoadFromFile (AFilename);
a file size of 500 mega bytes.
that it limits your component?

best regards
carlo narcisi

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 05 Jan 2011 13:41

Hello,

Thank you for the information.
We have reproduced the problem.
We will notify you as soon as we have any results.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 06 Jan 2011 08:44

Hello,

To resolve the problem you should use the 'OID' field type to store large amounts of data, because if you use the 'bytea' field type the data conversion to string with the special format (http://www.postgresql.org/docs/8.2/stat ... inary.html), and the size of data will increase.
So to store large amounts of data you can use the following code:

CREATE TABLE big_oid
(
id integer,
img oid
)

PgConnection.StartTransaction;
PgQuery.Open;
PgQuery.Append;
PgQuery.FieldByName('id').AsInteger:= 1;
TBlobField(PgQuery.FieldByName('img')).LoadFromFile('your_big_file');
PgQuery.Post;
PgConnection.Commit;

carlonarcisi
Posts: 29
Joined: Fri 10 Dec 2010 15:07

Post by carlonarcisi » Thu 27 Jan 2011 06:40

great
works !
thanks a lot

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 27 Jan 2011 07:41

Hello,

It is good to see that this problem was solved. If any other questions come up, please contact us.

Post Reply