Re: Storing images as BYTEA or large objects

From: Peter Wilson <petew(at)yellowhawk(dot)co(dot)uk>
To: Koen Vermeer <koen(at)vermeer(dot)tv>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing images as BYTEA or large objects
Date: 2008-02-13 15:21:51
Message-ID: 47B30B0F.3050206@yellowhawk.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Koen Vermeer wrote:
> On Wed, 2008-02-13 at 09:35 +0000, Peter Wilson wrote:
>
>> My preference : if I don't need the file-like interface to large objects
>> I'd use BYTEA every time.
>>
>
> 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.

Pete
--
http://www.whitebeam.org - JavaScript web application server.
http://www.yellowhawk.co.uk
> The large-objects-are-actually-files thing applies to my situation, so
> unless there is some 'large objects are / will be deprecated' argument,
> I guess I stick with large objects.
>
> Thanks!
>
> Koen
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>
>

--
------------------------------------------------------------------------
Peter Wilson
T: 01707 891840
M: 07796 656566
http://www.yellowhawk.co.uk The information in this email is
confidential and is intended for the addressee/s only. Access to this
email by anyone else is unauthorised. If you are not the intended
recipient, you must not read, use or disseminate the information
contained in or attached to this email.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ken Johanson 2008-02-13 16:07:42 Re: SELECT CAST(123 AS char) -> 1
Previous Message Hermann Muster 2008-02-13 15:19:09 Order of SUBSTR and UPPER in statement