Re: libpq (C++) - Insert binary data

From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: GOO Creations <goocreations(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: libpq (C++) - Insert binary data
Date: 2010-09-30 15:33:03
Message-ID: AANLkTikV8WpaS_HRFkbBNfYGW+hQayp=rDSSdw=6Ed6G@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/9/30 Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>:
> 2010/9/30 GOO Creations <goocreations(at)gmail(dot)com>:
>>  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 insert binary data and retrieve it
>> again?
>>
>> Thank you very much
>> Christoph
>
> Try chapter  31.3.4 from the v9 documentation.
> http://www.postgresql.org/docs/9.0/static/libpq-exec.html#LIBPQ-EXEC-ESCAPE-STRING

Sorry, I meant 30.3.5 in v8:
http://www.postgresql.org/docs/8.4/static/libpq-exec.html#LIBPQ-EXEC-ESCAPE-BYTEA

It looks like there's no such a thing in v9, though!

--
Vincenzo Romano at NotOrAnd Information Technologies
Software Hardware Networking Training Support Security
--
NON QVIETIS MARIBVS NAVTA PERITVS

In response to

Browse pgsql-general by date

  From Date Subject
Next Message GOO Creations 2010-09-30 15:36:29 Re: libpq (C++) - Insert binary data
Previous Message Grzegorz Jaśkiewicz 2010-09-30 15:32:47 Re: libpq (C++) - Insert binary data