Re: Storing images as BYTEA or large objects

From: Koen Vermeer <koen(at)vermeer(dot)tv>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing images as BYTEA or large objects
Date: 2008-02-13 19:52:18
Message-ID: 1202932338.3528.66.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Koen Vermeer 2008-02-13 19:53:49 Re: Storing images as BYTEA or large objects
Previous Message Michael Fuhr 2008-02-13 18:57:19 Re: Order of SUBSTR and UPPER in statement