Storing images as BYTEA or large objects

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

Hi,

I would like to store binary data in a PostgreSQL database. The size of
the data is about 2 to 20 MB and is always stored or retrieved as a
block (i.e., I do not need to get only part of the data). As I
understand, I have two options for storing this data: As BYTEA or as
large objects. As I understand, the disadvantage of the first method is
that I need to write a custom routine to escape some binary values - or
is there some code available to do this? The disadvantage of large
objects is their existence outside of the main database, which may be
problematic when backing up a database. In addition, I need special
routines to store/retrieve the data.

My two questions are: Is this summary correct? And: Which method should
I choose?

Best,
Koen

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2008-02-12 23:01:13 Re: [GENERAL] end of life for pg versions...
Previous Message Dave Cramer 2008-02-12 22:28:48 Re: deadlock while re-indexing table