Skip site navigation (1) Skip section navigation (2)

Re: libpq string escaping question

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Klaus Darilion" <klaus(dot)mailinglists(at)pernau(dot)at>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq string escaping question
Date: 2008-01-26 13:58:52
Message-ID: 80997033-7782-4973-bb3c-acae31b0a7c5@mm (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
	Klaus Darilion wrote:

> But how do I know if data is retrieved in text or binary format? I 
> that PQexecParams allows to specify the return format (text or 
> 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 
>  > retrieve the value to know how backslashes are processed. 
>  > of the parameter can also be taken as an indication that E'' 
>  > syntax is supported.)
> How can I retrieve this value?

Check out PQparameterStatus()

 PostgreSQL-powered mail user agent and storage:

In response to

pgsql-interfaces by date

Next:From: Markus SchiltknechtDate: 2008-01-29 09:46:46
Subject: Re: Is there an interface that...
Previous:From: Klaus DarilionDate: 2008-01-25 10:13:18
Subject: libpq string escaping question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group