----- Douglas Anderson <[EMAIL PROTECTED]> wrote:
> Anyone done any work with BLOBS in a PostgreSQL database?  

For small files you can use the bytea field type, I wouldn't use this method 
for larger files, as I'm loading the whole file into a string in memory, and 
passing a large sql string to postgres.  My files were only 15k so I didn't 
really care to use the Large Binary Objects.

Dim sql, file As String
Dim f As FolderItem
Dim bs As BinaryStream

f=GetFolderItem("some small file")
bs = f.OpenAsBinaryFile

While Not bs.EOF
   file = file + bs.Read(4096, Encodings.UTF8)
Wend

sql = "INSERT INTO table (file) VALUES ('" + EncodeBase64(file) + "')"

db.SQLExecute(sql)


The better way is to use the large objects example in the PostgreSQL Plugin 
from the beta program.

-Bill
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to