Re: possible design bug with PQescapeString() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: possible design bug with PQescapeString()
Date
Msg-id 11565.1140369228@sss.pgh.pa.us
Whole thread Raw
In response to Re: possible design bug with PQescapeString()  (Florian Weimer <fw@deneb.enyo.de>)
Responses Re: possible design bug with PQescapeString()
List pgsql-hackers
Florian Weimer <fw@deneb.enyo.de> writes:
> Uh-oh, this is my fault.  PQescapeString should escape all characters
> greater than 126.

No, that doesn't work, because the de-escaping on the backend side
happens *after* conversion to the backend encoding.  If you insert escapes
into the middle of multibyte characters then you break the conversion.

Tatsuo's description of the problem is accurate (though I'm not sure
I agree with his solution ;-))
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Prepared Xacts and Vacuum question
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Config file for psql