Re: question about images - Mailing list pgsql-novice

From Dag Gullberg
Subject Re: question about images
Date
Msg-id 03072416543304.01341@hemma
Whole thread Raw
In response to question about images  (Dag Gullberg <dag.gullberg@telia.com>)
List pgsql-novice
Tom Lane <tgl@sss.pgh.pa.us> writes:

>Dag Gullberg <dag.gullberg@telia.com> writes:
>>        I have a problem with understanding how BLOB's
>> work in postgres. It seems as thoug I have to use
>> COPY BINARY table (imagefield) FROM 'absolutepath+imagename' ;
>
>
>No, what you want is lo_import().
>
>                        regards, tom lane
>

Thanks for the input - and you're right! And wrong!
I first thought of it as a neccessity to have the db to
render me all data in a ''select * from table where id=this_id;''
including image data. I had a problem with the fact that lo_export()
deposit the data on the local fs - anti-constructive if you are trying
to setup a highly distributed and scalable solution. So in that
context you were wrong! Or so I thought...

*But*, thinking about it - the solution is simple - use lo_import and
lo_export as you suggest - and deposit the outdata in a directory
available from a apache-server, serving only image transfers.

I don't know about performance yet, but it is doable -have tested that.


Voila - I'm done (?)

Thanks,

DagG


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: question about images
Next
From: M Spreij
Date:
Subject: Re: Questions about Exists-Not exists clause