Re: [NOVICE] LibPQ, C, BLOB or BYTEA - Mailing list pgsql-novice

From Ruslan R. Laishev
Subject Re: [NOVICE] LibPQ, C, BLOB or BYTEA
Date
Msg-id 1679851508768317@web40o.yandex.ru
Whole thread Raw
In response to Re: [NOVICE] LibPQ, C, BLOB or BYTEA  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: [NOVICE] LibPQ, C, BLOB or BYTEA
List pgsql-novice
The question was "How To?". :-)
I looking for something like follows:
...
char __data_bytea[128];
 
 
RAND_bytes(__data_bytea, sizeof(__data_byte));
...
argv[0] = __data_bytea;
argl[0] = sizeof(__data_bytea);
 
...
PQexecPrepared ( ... argv, argl , ...);
 
 
 
PS:I know way conversion binary data to "binary data ASCII string" by PQescapeByteaConn(), but it's way to for real jedi.


23.10.2017, 16:20, "Merlin Moncure" <mmoncure@gmail.com>:

On Mon, Oct 23, 2017 at 7:00 AM, Ruslan R. Laishev <zator@yandex.ru> wrote:

 Hi All!

 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.

merlin



-- 
С уважением,
Ruslan R. Laishev
OpenVMS bigot, natural born system/network progger, C contractor.
+79013163222
+79910009922

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: [NOVICE] LibPQ, C, BLOB or BYTEA
Next
From: Stephen Froehlich
Date:
Subject: [NOVICE] Issues shutting down PostgreSQL 10 cleanly