realbasic-nug
[Top] [All Lists]

RE: BLOBs /w postgresql

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: RE: BLOBs /w postgresql
From: "Douglas Anderson" <danderson at vision-craft dot com>
Date: Mon, 30 Oct 2006 14:30:25 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: Acb5SAqVlZ2p5zWcRAWv+16TkgTD0wDIoGXA
Thread-topic: BLOBs /w postgresql
My initial tests look good.  I'm using the Beta 4 Plugin with 2006r3
right now.

Doug.

-----Original Message-----
From: realbasic-nug-bounces at lists dot realsoftware dot com
[mailto:realbasic-nug-bounces at lists dot realsoftware dot com] 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 <danderson at vision-craft dot com> 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>


<Prev in Thread] Current Thread [Next in Thread>