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 20110727065122.205180@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">If<span style="mso-spacerun:yes">  </span>I use PQescapeByteaConn() for a conenction to a PG9.1
Beta3server, this function returns (e.g.) <strong style="mso-bidi-font-weight:normal">"\xea2abd8ef31...(and so
on.)..."</strong>.<pclass="MsoNormal"><p class="MsoNormal">Here the problem: there should be a second backslash in the
prefix.<spanstyle="mso-spacerun:yes"> T</span>he SQL Statement which uses this string (INSERT statement in my case)
returnswith an error ("Invalid byte sequence..."). If I add the second backslash manually everything works fine.<p
class="MsoNormal"><pclass="MsoNormal">When connecting to a PG9.0 server and using this function, the return value is
correct(with two backslashes): <strong style="mso-bidi-font-weight:       normal">"<a>\\xea2abd8ef31...( and so
on.)...</a>"</strong>.<pclass="MsoNormal"><p class="MsoNormal">This should be a bug in PG9.1 Beta3<p
class="MsoNormal"> <pclass="MsoNormal">Regards<p class="MsoNormal"><p class="MsoNormal">Petro <div
class="signature"><br/><br /><br />-- <br />NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! <br
/>Jetztinformieren: http://www.gmx.net/de/go/freephone</div> 

pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: XMLATTRIBUTES vs. values of type XML
Next
From: Florian Pflug
Date:
Subject: Re: PQescapeByteaConn - returns wrong string for PG9.1 Beta3