Re: Storing images as BYTEA or large objects - Mailing list pgsql-general

From Koen Vermeer
Subject Re: Storing images as BYTEA or large objects
Date
Msg-id 1202932338.3528.66.camel@localhost
Whole thread Raw
In response to Re: Storing images as BYTEA or large objects  (Peter Wilson <petew@yellowhawk.co.uk>)
List 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


pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Order of SUBSTR and UPPER in statement
Next
From: Koen Vermeer
Date:
Subject: Re: Storing images as BYTEA or large objects