Re: BLOB or BYTEA field - Mailing list pgsql-general

From Jonathan Bartlett
Subject Re: BLOB or BYTEA field
Date
Msg-id Pine.GSU.4.44.0302191423130.20576-100000@eskimo.com
Whole thread Raw
In response to Re: BLOB or BYTEA field  (cnliou9@fastmail.fm (CN))
List pgsql-general
BLOBs are actually created using lo_create - you are then returned an OID
that can essentially be used as a file descriptor.  However, in my
programs, I've opted for bytea for the following reasons:

 * You can't query for BLOBs and know if there is a dangling reference

 * BLOBs use OID fields.  Running out of OIDs is a problem in PostgreSQL
because they are only four bytes wide.  This makes BLOBs useless for large
databases.

 * bytea fields are easier to manipulate

I think I had some other reaons, but I can't think of them right now.

I also just liked storing the binary object itself as an attribute rather
than a somewhat dangling entity.

Jon

On 18 Feb 2003, CN wrote:

> Hi! Daniel,
>
> >
> > you should use oid Fields for BLOBS. That works well.
> >
>
> I have the same question. Could you make it more specific? oid is an
> unsigned 4 bytes integer. How do you save binary data from Delphi in
> bytea column "using oid fields"?
>
> Thanks you!
>
> CN
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


pgsql-general by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: Table Partitioning in Postgres:
Next
From: Martijn van Oosterhout
Date:
Subject: Re: 7.3.1 takes long time to vacuum table?