My initial tests look good. I'm using the Beta 4 Plugin with 2006r3 right now.
Doug. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Goodrich Sent: Thursday, October 26, 2006 3:45 PM To: REALbasic NUG Subject: Re: BLOBs /w postgresql I thought they had released the new postgres plug in but I just looked. It is actually include in the 2006R4 but it is called "PostgreSQL Plugin Beta 4.rbx". So I guess it is sort of released but with no guarantees. Bill Cavalieri wrote: > ----- 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> > > _______________________________________________ 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> _______________________________________________ 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>
