Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 2D04D2E0038 for ; Sat, 26 Jan 2008 09:59:07 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 82534-02 for ; Sat, 26 Jan 2008 09:58:50 -0400 (AST) Received: from sd-9404.dedibox.fr (sd-9404.dedibox.fr [88.191.51.144]) by postgresql.org (Postfix) with ESMTP id 9C88E2E35AE for ; Sat, 26 Jan 2008 09:59:01 -0400 (AST) Received: by sd-9404.dedibox.fr (Postfix, from userid 1002) id F01F8D5C7BA; Sat, 26 Jan 2008 14:58:56 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Mailer: Manitou v0.9.9 From: "Daniel Verite" Subject: Re: libpq string escaping question To: "Klaus Darilion" CC: pgsql-interfaces@postgresql.org In-Reply-To: <4799B63E.90006@pernau.at> Date: Sat, 26 Jan 2008 14:58:52 +0100 Message-ID: <80997033-7782-4973-bb3c-acae31b0a7c5@mm> X-Face: 0N#]; "Miw2ss`WySq(ZLLy[=.ai4D}yI#'n*PU:{%/ZVSUd*G$EuN$v@TyBnpW5x=-m*Jc?Cm&=kXN#l; pePLb!,P.9D4M]fHU+XMPTe(>>'( X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/17 X-Sequence-Number: 6695 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