Re: libpq string escaping question - Mailing list pgsql-interfaces

From Daniel Verite
Subject Re: libpq string escaping question
Date
Msg-id 80997033-7782-4973-bb3c-acae31b0a7c5@mm
Whole thread Raw
In response to libpq string escaping question  (Klaus Darilion <klaus.mailinglists@pernau.at>)
List pgsql-interfaces
    Klaus Darilion wrote:

> But how do I know if data is retrieved in text or binary format? I 
read
> that PQexecParams allows to specify the return format (text or 
binary)
> but what about PQexec() and PQgetResult()? Do they return binary or
> text? Or is it configurable for PQexec ann PQgetResult too?

PQfformat() applied to a column of a result indicates whether it's text 
or binary.
When the query is run through PQexec(), my understanding is that 
results will always be in text format except if specified otherwise at 
the SQL level. That would be the case for a FETCH from a BINARY CURSOR. 
I'm not sure if there is any other case, BTW, anyone knows?

> Further from the docs (about E'' syntax):
>  > The standard_conforming_strings value is read-only. Applications 
can
>  > retrieve the value to know how backslashes are processed. 
(Presence
>  > of the parameter can also be taken as an indication that E'' 
string
>  > syntax is supported.)
> 
> How can I retrieve this value?

Check out PQparameterStatus()

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


pgsql-interfaces by date:

Previous
From: Klaus Darilion
Date:
Subject: libpq string escaping question
Next
From: fschmidt
Date:
Subject: Is there an interface that...