Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D9BBA9FB2A7 for ; Wed, 7 Feb 2007 22:09:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 48892-06 for ; Wed, 7 Feb 2007 22:08:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id DA51C9FA37A for ; Wed, 7 Feb 2007 22:08:42 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 5479B30E36; Thu, 8 Feb 2007 03:08:41 +0100 (MET) From: ljb X-Newsgroups: pgsql.interfaces.php Subject: Re: pg_[un]escape_bytea, pgsql 8.2.1, php 5.1.6, Linux Date: Thu, 8 Feb 2007 02:08:41 +0000 (UTC) Organization: Hub.Org Networking Services Lines: 15 Message-ID: References: <302670f20702011827x28d9a689m388b2c8a703f31af@mail.gmail.com> <302670f20702022009x417a210fm5e0fa36d860a225@mail.gmail.com> <200702051101.40315.vdephily@bluemetrix.com> <302670f20702070658vb0913e2xa51d153ddbe5b34d@mail.gmail.com> X-Complaints-To: usenet@news.hub.org X-No-Archive: yes User-Agent: slrn/0.9.8.1 (Linux) To: pgsql-php@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/13 X-Sequence-Number: 3696 gwchamb@gmail.com wrote: > Vincent... > >> This would be a problem related to php, not postgres. I'm handling binary data >> in parameterized and COPY queries just fine with c++. > > I'm not ruling-out PHP, but I've seen claims of pg_[un]escape_bytea > being only wrappers to the Pg functions. That is correct, the PHP function relies on the PostgreSQL library to do the work. But the problem of using a parameterized query with bytea data is specific to PHP. PostgreSQL allows you to either escape the bytea data for use as a text-mode parameter, or pass it 'raw' as a binary-mode parameter. I don't know a good way to do the first in PHP, and the PHP PostgreSQL interface doesn't support the second at all.