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

From Tom Lane
Subject Re: PQescapeByteaConn - returns wrong string for PG9.1 Beta3
Date
Msg-id 14970.1312491254@sss.pgh.pa.us
Whole thread Raw
In response to PQescapeByteaConn - returns wrong string for PG9.1 Beta3  ("Petro Meier" <Petro85@gmx.de>)
Responses Re: PQescapeByteaConn - returns wrong string for PG9.1 Beta3
List pgsql-hackers
"Petro Meier" <Petro85@gmx.de> writes:
>          INSERT INTO "testtable" ("ID", "BinaryContents") values (1, 
> E'\xea2abd8ef3');        
>          returns "invalid byte sequence".         

>          '\xea2abd8ef3' is the string delivered by the PG 9.1 Beta3 server 
> when calling PQescapeByteaConn(). It cannot be further processed by the 
> server itself afterwards! There is a leading '\' missing.         

No, there isn't.  What you are doing wrong is prepending an E to the
literal.  You should not be doing that, neither in 9.1 nor any previous
version.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Further news on Clang - spurious warnings
Next
From: Tom Lane
Date:
Subject: Re: Reduce WAL logging of INSERT SELECT