PQescapeByteaConn - returns wrong string for PG9.1 Beta3 - Mailing list pgsql-hackers

From Petro Meier
Subject PQescapeByteaConn - returns wrong string for PG9.1 Beta3
Date
Msg-id 20110803131906.116290@gmx.net
Whole thread Raw
Responses Re: PQescapeByteaConn - returns wrong string for PG9.1 Beta3
Re: PQescapeByteaConn - returns wrong string for PG9.1 Beta3
List pgsql-hackers
<p class="MsoNormal">Please let me clarify the bug:<p class="MsoNormal"> <p class="MsoNormal">CREATE TABLE
"testtable"<pclass="MsoNormal">(<p class="MsoNormal"><span style="mso-spacerun:yes">  </span>"ID" integer NOT NULL,<p
class="MsoNormal"><spanstyle="mso-spacerun:yes">  </span>"BinaryContents" bytea<p class="MsoNormal">);<p
class="MsoNormal"> <pclass="MsoNormal">INSERT INTO "testtable" ("ID", "BinaryContents") values (1, E'\xea2abd8ef3');<p
class="MsoNormal"> <pclass="MsoNormal">returns "invalid byte sequence". <p class="MsoNormal"> <p
class="MsoNormal">'\xea2abd8ef3'is the string delivered by the PG 9.1 Beta3 server when calling PQescapeByteaConn(). It
cannotbe further processed by the server itself afterwards! There is a leading '\' missing. <p class="MsoNormal"> <p
class="MsoNormal">Whencalling the function for a PG 9.0.1 server, then the result (correctly) is '\\xea2abd8ef3' (with
adouble-backslash!), and then the insert works fine, both, with PG9.1 Beta3 and PG9.0.1<p class="MsoNormal"> <p
class="MsoNormal">Itis a serious issue, as it will break all existing PostgreSQL applications that deal with binary
contentsand use PQescapeByteaConn().<p class="MsoNormal"> <p class="MsoNormal">Best regards<p
class="MsoNormal">Petro<divclass="signature"><br /><br /><br />-- <br />Empfehlen Sie GMX DSL Ihren Freunden und
Bekanntenund wir<br />belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de</div> 

pgsql-hackers by date:

Previous
From: Vorarlberger
Date:
Subject: possible new feature: asynchronous sql or something like oracles dbms_job.submit
Next
From: Bruce Momjian
Date:
Subject: Reduce WAL logging of INSERT SELECT