Re: libpq (C++) - Insert binary data - Mailing list pgsql-general

From Steve Atkins
Subject Re: libpq (C++) - Insert binary data
Date
Msg-id 1D2BFE0A-2D28-4383-9AFE-AAAD7AF42B60@blighty.com
Whole thread Raw
In response to libpq (C++) - Insert binary data  (GOO Creations <goocreations@gmail.com>)
Responses Re: libpq (C++) - Insert binary data  (GOO Creations <goocreations@gmail.com>)
List pgsql-general
On Sep 30, 2010, at 8:26 AM, GOO Creations wrote:

> Hi there,
>
> I'm sitting for days now, and I can't get this to work:
>
> I want to insert binary data (bytea) into my postgres DB via the c++ libpq.
>
> What I have is a char* (actually a QByteArray) and I want to insert it into the DB and the retrieve it from there
again.
>
> I can't find any good examples or tutorials online, so can anyone help me (or direct met to a tutorial) on how to
insertbinary data and retrieve it again? 

Is there any reason you're not using the Qt database API? It'll map onto what you're doing much more easily than using
libpq.

(Also, libpq isn't a C++ API, so maybe you're thinking of something else, like libpqxx?)

Cheers,
  Steve


pgsql-general by date:

Previous
From: GOO Creations
Date:
Subject: Re: libpq (C++) - Insert binary data
Next
From: GOO Creations
Date:
Subject: Re: libpq (C++) - Insert binary data