Storing files in PostgreSQL 8.1



Hi,

I'm using Delphi 2006 to insert data into a PostgreSQL 8.1 table, containing a bytea field which should store Word documents.

I have decided to use ADO (dbGO).
My problem is that if I interpret the bytea field as a String (by creating a field at design-time for the AdoRecordSet), and use a FileToString() routine written by me, it stores only about the first 8k of the file! (and I think it's a bad solution, since I should keep in memory a very big string for files of some megabytes...).
I have also changed the driver settings in the Control Panel, but the problem still remains.

How could I efficiently and correctly store a file (and not its path) in a bytea field? I need to use just bytea, not OIDs...


Could anyone help me, please?

Thanks.
.



Relevant Pages

  • Storing data into a PostgreSQL 8.1 table
    ... I'm using Delphi 2006 to insert data into a PostgreSQL 8.1 table, containing a bytea field which should store Word documents. ... Since Zeos does NOT work with D2006, I have decided to use ADO, which seems to work quite well. ... My problem is that if I interpret the bytea field as a String, and use a FileToStringroutine written by me, it stores only about the first 8k of the file! ...
    (borland.public.delphi.database.ado)
  • Re: Literal Escaped Octets
    ... order to store it in a bytea field on postgresql server. ... easily in c/c++ but I need to do it in python. ... and evaluate the binary value of a byte in a long string when it is a non ... Have you considered just encoding the data as text in hex or base64, e.g., ...
    (comp.lang.python)
  • RE: Using Rich Text formating with InfoPath
    ... string and store it to the SQL database. ... ADO is the component you use to ...
    (microsoft.public.data.ado)