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
blob fields limit ? or record limit ?
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;
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;