Skip site navigation (1) Skip section navigation (2)

Re: Storing Binary Large Objects

From: "Mark Wong" <markwkm(at)gmail(dot)com>
To: "Rich Shepard" <rshepard(at)appl-ecosys(dot)com>
Cc: pdxpug(at)postgresql(dot)org
Subject: Re: Storing Binary Large Objects
Date: 2007-03-28 23:09:10
Message-ID: 70c01d1d0703281609v59f63a22we4b090d4646359e2@mail.gmail.com (view raw or flat)
Thread:
Lists: pdxpug
On 3/28/07, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
>    I've not before needed to store BLOBs in a database, but now I do.
> Specifically, I need to store scanned pages as .pdf files within a table.
>
>    Looking at the 8.2 docs I see there is a bytea data type that references
> the SQL standard of blob (different input format, same functions and
> operators). Is bytea the data type I want to use? If so, are there any
> special considerations to storing and retrieving those files?
>
>    Pointers to more specific docs would be helpful.

If memory serves, there are two types: bytea and oid.  There are
probably significant usage differences but only one of the
implementation differences sticks to my mind.  With bytea the binary
data is stored with the rest of the table data.  With oid, the binary
data is stored within another table and the oid column is basically a
reference to a row in that table.  Anyone who uses an oid data type
shares the same table to store binary data.

I'm kind of curious to how oid came to be as that seems pretty awkward
to me.  Anyway, that's all I know...

Mark

In response to

Responses

pdxpug by date

Next:From: Rich ShepardDate: 2007-03-28 23:27:41
Subject: Re: Storing Binary Large Objects
Previous:From: Rich ShepardDate: 2007-03-28 22:39:58
Subject: Re: ER Diagramming Tools?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group