X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 49572D1B560 for ; Mon, 29 Sep 2003 18:22:30 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 45604-04 for ; Mon, 29 Sep 2003 15:22:03 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 50368D1B522 for ; Mon, 29 Sep 2003 15:22:01 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8TIM16c027076; Mon, 29 Sep 2003 14:22:01 -0400 (EDT) To: Igor Shevchenko Cc: pgsql-interfaces@postgresql.org Subject: Re: PQescapeString handling of \0 In-reply-to: <200309291949.26188.igor@carcass.ath.cx> References: <200309291949.26188.igor@carcass.ath.cx> Comments: In-reply-to Igor Shevchenko message dated "Mon, 29 Sep 2003 19:49:26 +0300" Date: Mon, 29 Sep 2003 14:22:01 -0400 Message-ID: <27075.1064859721@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/70 X-Sequence-Number: 4488 Igor Shevchenko writes: > Here's a patch which makes PQescapeString stop escaping when \0 is seen. Hm. Is that really the right behavior? Given that the function is defined to take a counted string rather than a null-terminated string, I'd sort of expect it to turn \0 into "\000" or some such. Of course, given that this could overflow the specified size of the return buffer, one might simply conclude that the defined API is broken ... regards, tom lane