Re: LibPQ, C, BLOB or BYTEA

From: Ruslan R(dot) Laishev <zator(at)yandex(dot)ru>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: LibPQ, C, BLOB or BYTEA
Date: 2017-10-23 14:18:37
Message-ID: 1679851508768317@web40o.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

<div>The question was "How To?". :-)</div><div>I looking for something like follows:</div><div>...</div><div>char __data_bytea[128];</div><div> </div><div> </div><div>RAND_bytes(__data_bytea, sizeof(__data_byte));</div><div>...</div><div>argv[0] = __data_bytea;</div><div>argl[0] = sizeof(__data_bytea);</div><div> </div><div>...</div><div>PQexecPrepared ( ... argv, argl , ...);</div><div> </div><div> </div><div> </div><div>PS:I know way conversion binary data to "binary data ASCII string" by PQescapeByteaConn(), but it's way to for real jedi.</div><div><br /></div><div><br /></div><div>23.10.2017, 16:20, "Merlin Moncure" &lt;mmoncure(at)gmail(dot)com&gt;:</div><blockquote type="cite"><p>On Mon, Oct 23, 2017 at 7:00 AM, Ruslan R. Laishev &lt;<a href="mailto:zator(at)yandex(dot)ru">zator(at)yandex(dot)ru</a>&gt; wrote:<br /></p><blockquote> Hi All!<br /><br /> Is there a way to pass BYTEA values w/o formating to escape/hex binary ASCII<br /> strings from C to plpqsql stored function ?<br /></blockquote><p><br />From a C client application? Yes, you need to use the binary wire format.<br /><br />merlin<br /></p></blockquote><div><br /></div><div><br /></div><div>-- </div><div>С уважением,<br /> Ruslan R. Laishev</div><div>OpenVMS bigot, natural born system/network progger, C contractor.</div><div>+79013163222</div><div>+79910009922</div><div><br /></div>

Attachment Content-Type Size
unknown_filename text/html 1.3 KB

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Stephen Froehlich 2017-10-23 19:23:04 Issues shutting down PostgreSQL 10 cleanly
Previous Message Tom Lane 2017-10-23 14:03:38 Re: LibPQ, C, BLOB or BYTEA