Re: possible design bug with PQescapeString()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
Cc: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: possible design bug with PQescapeString()
Date: 2006-02-19 17:13:48
Message-ID: 11565.1140369228@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Florian Weimer <fw(at)deneb(dot)enyo(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-02-19 17:25:17 Re: [HACKERS] Config file for psql
Previous Message Tom Lane 2006-02-19 17:10:16 Re: Prepared Xacts and Vacuum question