Re: LibPQ, C, BLOB or BYTEA

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: "Ruslan R(dot) Laishev" <zator(at)yandex(dot)ru>, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: LibPQ, C, BLOB or BYTEA
Date: 2017-10-23 14:03:38
Message-ID: 13714.1508767418@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> On Mon, Oct 23, 2017 at 7:00 AM, Ruslan R. Laishev <zator(at)yandex(dot)ru> wrote:
>> Is there a way to pass BYTEA values w/o formating to escape/hex binary ASCII
>> strings from C to plpqsql stored function ?

> From a C client application? Yes, you need to use the binary wire format.

Yeah, specifically see PQexecParams() or one of its sibling functions.
You need to execute some command like "SELECT myfunc($1::bytea)" and
then pass the parameter value in binary format.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ruslan R. Laishev 2017-10-23 14:18:37 Re: LibPQ, C, BLOB or BYTEA
Previous Message Merlin Moncure 2017-10-23 13:20:20 Re: LibPQ, C, BLOB or BYTEA