Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id CD7589FB2C9 for ; Thu, 1 Feb 2007 22:27:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 72028-08 for ; Thu, 1 Feb 2007 22:27:25 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id E469B9FB1DD for ; Thu, 1 Feb 2007 22:27:24 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so581128ugf for ; Thu, 01 Feb 2007 18:27:23 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=lqu+Oc0XS77KO6HF1fv7OwoUazVZAjmilarEcVSsfETtmuNGjCJGo5M3Yyz1F6pRjt/EuNGrfH+m2QxOTdkxyQowwdN1pgJzJdxP7JIaPwBQ79LXcJpFPjzriLj16xuFhsf/RzcYgss3EFJME8bKYpd0egx7+x3RNgSsY1qEVDo= Received: by 10.78.17.1 with SMTP id 1mr748866huq.1170383243159; Thu, 01 Feb 2007 18:27:23 -0800 (PST) Received: by 10.78.105.8 with HTTP; Thu, 1 Feb 2007 18:27:23 -0800 (PST) Message-ID: <302670f20702011827x28d9a689m388b2c8a703f31af@mail.gmail.com> Date: Thu, 1 Feb 2007 21:27:23 -0500 From: "Gary Chambers" To: pgsql-php@postgresql.org Subject: pg_[un]escape_bytea, pgsql 8.2.1, php 5.1.6, Linux MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/1 X-Sequence-Number: 3684 All... Apache 2.2.3, PostgreSQL 8.2.1, PHP 5.1.6, Linux I have inserted (via pg_query_params) into a bytea field some binary data (a JPEG image in this case) which I have escaped using pg_escape_bytea. It appears, however, that the extracted data is corrupt (NOT unescaped, more precisely), even after unescaping it with pg_unescape_bytea. If I perform another (a subsequent) pg_unescape_bytea, it appears to be partially unescaped, but there still remain errors because the rest of the image is severely distorted -- but minimally recognizeable as part of the original image. What am I missing? I'm using the lo_* functions as an alternative, but it's hard to dismiss the ease with which it appears to deal with binary data with a bytea field. Many thanks in advance! -- Gary Chambers // Nothing fancy and nothing Microsoft!