logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Libpq: PQunescapeBytea: msg#00030

Subject: Re: Libpq: PQunescapeBytea
        CN wrote:

> Question: Does it mean that there exist some functions being able to
> retrieve bytea columns in "binary format"? My understanding of its
> meaning is that these functions will automatically restore the data read
> from database to their original unescaped binary strings and thus
> PQescapeBytea needs not to be called. If it does, what are these
> functions? PQgetvalue appears to be not one of them I think.

There's no specific function but when you pass 1 to the
'resultFormat' parameter of PQexecParams(), its results are
returned in binary format.
Then PQgetvalue() will give you the address of the data and
PQgetlength() its size. When this data is of type bytea, no
conversion is required.

-- 
 Daniel
 PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org



<Prev in Thread] Current Thread [Next in Thread>