Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29747 invoked from network); 25 Jun 2013 22:44:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jun 2013 22:44:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.49 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.49 mail-la0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:56822] helo=mail-la0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/04-11452-26D1AC15 for ; Tue, 25 Jun 2013 18:44:50 -0400 Received: by mail-la0-f49.google.com with SMTP id ea20so12783920lab.36 for ; Tue, 25 Jun 2013 15:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=tqGrzm+Ta8xy+iK6rG6iooksLy9VuAM2TBTKjLWq7NI=; b=MYg1xOCofB39sr5tVU+hLSpT5bwyHHlNPv0QWwor5RIKhJq+KbdBR/EdZhAlOUeXyw EdCqI89wxnK3Pcs1V/orazzVb6sCg9vqRhEDaV3j69CiKCv/2Hc0zJVu47n9ToFPlcWl uazPxG+mx2T6ucnK/HPzv6BtEPit+FPiIc839L4AxR/ZN0yM02CaCnaYAvcdhZpTkRIC qkxBw8gvc3kEYMPXyIZvP9b7i0qOoSmyqUY69leo21s40yuy8QJPAIao+BHR8+VvR9Vy iW3hVUsSx/dsB/DT9TvMFfUgoWCrjZ2dTsNltupjYpC8tH99sq2qx6WzGf636psme0P2 FPGA== X-Received: by 10.112.219.102 with SMTP id pn6mr883302lbc.18.1372200286648; Tue, 25 Jun 2013 15:44:46 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.4.233 with HTTP; Tue, 25 Jun 2013 15:44:06 -0700 (PDT) Date: Wed, 26 Jun 2013 07:44:06 +0900 X-Google-Sender-Auth: E9PClQPNBK1jZS85HeSHZPX00QQ Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3ca14a57f6f04e0024653 Subject: pgsql: Binary data support improvement From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c3ca14a57f6f04e0024653 Content-Type: text/plain; charset=ISO-8859-1 Hi all, Current pgsql module lacks direct binary support. Therefore, users have to use pg_escape_bytea/pg_unescape_bytea for binary handling even with prepared statement type APIs. Use of pg_escape_bytea/pg_unescape_bytea requires some overheads on both server and client side. Following patch enables pg_execute() to handle binary directly. https://github.com/yohgaki/php-src/compare/pgsql_binary_support NOTE: This patch is only for PoC and treats all parameters as binary, returns binary result ALWAYS. i.e. Not only bytea, but int, float, numeric, etc are returned as binary. I'm planning to add $params_format(array) and $binary_result(bool) parameter. pg_execute() will look like Current: resource pg_execute ([ resource $connection ], string $stmtname , array $params ) New: resource pg_execute ([ resource $connection ], string $stmtname , array $params [, array $params_format [, bool $binary_result]] ) Any thoughts? -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c3ca14a57f6f04e0024653--