Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67848 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81420 invoked from network); 26 Jun 2013 09:15:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 09:15:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain beccati.com designates 176.9.114.167 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 176.9.114.167 spritz.beccati.com Received: from [176.9.114.167] ([176.9.114.167:49697] helo=mail.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/23-60917-231BAC15 for ; Wed, 26 Jun 2013 05:15:32 -0400 Received: (qmail 24156 invoked from network); 26 Jun 2013 09:15:27 -0000 Received: from home.beccati.com (HELO ?192.168.1.202?) (88.149.176.119) by mail.beccati.com with SMTP; 26 Jun 2013 09:15:27 -0000 Message-ID: <51CAB115.60602@beccati.com> Date: Wed, 26 Jun 2013 11:15:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Yasuo Ohgaki CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] pgsql: Binary data support improvement From: php@beccati.com (Matteo Beccati) On 26/06/2013 00:44, Yasuo Ohgaki wrote: > New: > resource pg_execute ([ resource $connection ], string $stmtname , array > $params [, array $params_format [, bool $binary_result]] ) > > Any thoughts? Using binary format "requires knowledge of the internal representation expected by the backend. For example, integers must be passed in network byte order", quoting the libpq documentation. Although it is possible to specify whether or not each parameter is binary, the same is not possible for the result due to a limitation in libpq. Meaning that $binary_result can only be used for queries returning one or more bytea fields. I would be happier if we could make this transparent to the user, but I don't see any feasible way to do this, at least for the results. I have mixed feelings... I see where this might come in handy, but I think it would be a bit too user-unfriendly. PDO_pgsql on the other hand, when used with explicit parameter binding, could automatically use binary format for LOB fields. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/