X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2EE54D9090 for ; Thu, 15 Sep 2005 21:22:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78656-06 for ; Fri, 16 Sep 2005 00:22:21 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 4A1DAD9084 for ; Thu, 15 Sep 2005 21:22:22 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j8G0MN9v047726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Sep 2005 18:22:25 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j8G0MN3U072738; Thu, 15 Sep 2005 18:22:23 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j8G0MM2W072737; Thu, 15 Sep 2005 18:22:22 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 15 Sep 2005 18:22:22 -0600 From: Michael Fuhr To: Mark Richardson Cc: pgsql-interfaces@postgresql.org Subject: Re: libpq, ecpg and the bytea data type Message-ID: <20050916002222.GA72513@winnie.fuhr.org> References: <20050915191806.66041.qmail@unknown-206-190-38-164.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050915191806.66041.qmail@unknown-206-190-38-164.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/26 X-Sequence-Number: 5749 On Thu, Sep 15, 2005 at 12:18:05PM -0700, Mark Richardson wrote: > But the ECPG part still doesn't seem to have the correct behavior. > With the following in a .pgc file... The code you posted has several syntax errors so it can't be what you're running. When posting examples, please show exactly what you're doing so people don't have to guess at what corrections to make. In any case, others have reported trouble handling bytea with ECPG; see the list archives for previous discussion. I see a lot of calls to strlen() in the ECPG source code, so it might not be designed to handle binary data. You might need to fetch the data in non-binary mode and use PQunescapeBytea() to convert the escape sequences to binary. -- Michael Fuhr