Re: Handling Blobs with libpq

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Stéphane Pinel <spinel(at)noos(dot)fr>
Cc: PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: Handling Blobs with libpq
Date: 2003-03-20 16:50:03
Message-ID: m3fzpi7zk4.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stéphane Pinel <spinel(at)noos(dot)fr> writes:

> What is the best approach to handle blobs with libpq ?
>
> I've read in documentation that there are 2 ways:
>
> 1- Bytea
> 2- Larges objects (lo_import)
>
> 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.

You don't have to use lo_import()--you can write from memory to a large
object using lo_write(), and read an LO (or part of one) into memory
using lo_read(). See the documentation.

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kevin 2003-03-20 16:51:51 Postgreslq Driver in Java & Windows
Previous Message Daniel R. Anderson 2003-03-20 16:47:26 Re: PostgreSQL downloads compressed with bzip2 instead of