Search Postgresql Archives

Re: Storing images as BYTEA or large objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Op woensdag 13-02-2008 om 15:21 uur [tijdzone +0000], schreef Peter
Wilson:
> > Right, so that basically means that when 'large objects' are files,
> > which should be saved and restored as a whole, it may be more natural to
> > use the large objects. I guess that applies to some uses of media
> > storage (music, photos, video).
> No - I meant the Postgres large object interface allows you to read and 
> write sections of a
> large object. It provides a seek/read/write interface.
> If you're only going to read or write the whole contents as a single 
> block then use BYTEA. In
> my case I store uploaded images as BYTEA - I only every need to 
> read/write the image as a whole.
> If you were dealing with very large images/music/video in a web 
> environment then I could see a
> web application wanting to read a chunk - write to the web client - read 
> next chunk etc and thus
> avoid the overhead of the entire contents being in memory at one time. 
> That probably doesn't
> help with upload though.

In my case, the web application only downloads the data. Upload is done
through a custom, local application. So I guess BYTEA would work fine
for me. I'll do some more reading to see if any of its other properties
wouldn't match my needs and if both BYTEA and large objects seem to
suite me, I'll go for BYTEA.

Thanks for the help!

Koen


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux