Re: Handling Blobs with libpq

From: Daniel Bruce Lynes <dlynes(at)shaw(dot)ca>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Handling Blobs with libpq
Date: 2003-03-21 22:42:07
Message-ID: 200303211442.07705.dlynes@shaw.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Thursday 20 March 2003 01:56, Stéphane Pinel wrote:

> My main need is storing pictures (like Jpegs etc) or small blobs. Doc
> says that (2) is more
> appropriate but I need to work with blobs in memory, not from files.

If you need to work with it in memory, you're better off using the bytea (same
thing as a varbinary). LOBs are generally for when the data is so large that
the performance of your application would be comprimised if you allocated
memory for the contents. LOBs allow you to do streaming so that you don't
need to allocate memory. Only the lo_export/lo_import functions require a
file. All of the other LOB functions only require a stream that's chunked
into byte arrays.

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-03-21 22:46:41 Re: [INTERFACES] Roadmap for FE/BE protocol redesign
Previous Message Bruce Momjian 2003-03-21 22:36:03 Re: [INTERFACES] Roadmap for FE/BE protocol redesign