mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add PQunescapeBytea libpq function.
Everyone using libpq and bytea is probably having to invent this wheel.. Patrick Welche
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.87 2002/01/18 20:39:04 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.88 2002/03/04 23:59:11 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="libpq">
|
||||
@ -955,6 +955,25 @@ strings overlap.
|
||||
byte is also added. The single quotes that must surround
|
||||
PostgreSQL string literals are not part of the result string.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>PQunescapeBytea</function>
|
||||
Converts an escaped string representation of binary data into binary
|
||||
data - the reverse of <function>PQescapeBytea</function>.
|
||||
<synopsis>
|
||||
unsigned char *PQunescapeBytea(unsigned char *from, size_t *to_length);
|
||||
</synopsis>
|
||||
|
||||
The <paramater>from</parameter> parameter points to an escaped string
|
||||
such as might be returned by <function>PQgetvalue</function> of a
|
||||
<type>BYTEA</type> column. <function>PQunescapeBytea</function> converts
|
||||
this NUL terminated string representation into binary, filling a buffer.
|
||||
It returns a pointer to the buffer which is NULL on error, and the size
|
||||
of the buffer in <parameter>to_length</parameter>. The pointer may
|
||||
subsequently be used as an argument to the function
|
||||
<function>free(3)</function>.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user