pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Verite <daniel@manitou-mail.org>
To: Klaus Darilion <klaus.mailinglists@pernau.at>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpq string escaping question
Date: Sat, 26 Jan 2008 14:58:52 +0100
Message-ID: <80997033-7782-4973-bb3c-acae31b0a7c5@mm> (raw)
In-Reply-To: <4799B63E.90006@pernau.at>

	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()

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



view thread (2+ messages)

Message-ID: <80997033-7782-4973-bb3c-acae31b0a7c5@mm>
Permalink:  ../80997033-7782-4973-bb3c-acae31b0a7c5@mm/
Also on:    postgresql.org/message-id/80997033-7782-4973-bb3c-acae31b0a7c5@mm

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: daniel@manitou-mail.org, klaus.mailinglists@pernau.at
  Subject: Re: libpq string escaping question
  In-Reply-To: <80997033-7782-4973-bb3c-acae31b0a7c5@mm>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox