Re: BLOB or BYTEA field

From: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
To: CN <cnliou9(at)fastmail(dot)fm>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: BLOB or BYTEA field
Date: 2003-02-19 22:27:04
Message-ID: Pine.GSU.4.44.0302191423130.20576-100000@eskimo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2003-02-19 22:41:16 Re: 7.3.1 takes long time to vacuum table?
Previous Message Jean-Luc Lachance 2003-02-19 22:14:25 Re: Table Partitioning in Postgres: