Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68035 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65895 invoked from network); 2 Jul 2013 10:52:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2013 10:52:46 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.42 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.128.42 mail-qe0-f42.google.com Received: from [209.85.128.42] ([209.85.128.42:44005] helo=mail-qe0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/92-49923-DF0B2D15 for ; Tue, 02 Jul 2013 06:52:45 -0400 Received: by mail-qe0-f42.google.com with SMTP id s14so2260468qeb.29 for ; Tue, 02 Jul 2013 03:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=DUVvQzimu7CGwIJOVtRdQc6NVjdU0JRsUYvkGtLoMoA=; b=ZQln/KLx4VurHGMta7jaXie3SRErgD7O2VSYAqHdgokRvr9Qm9ElKRzHViS9Jt+Zmt v1sP2S75DF1iy6PiBNaqGjq6lwjNyKt/GiGvj6y9JEwRJh3084xnipGTbrSRLJKodL7k xSHEkdgaC7UMdn35Efs755ZTwM1Y/kiYRQfoMrrZvia1bMSYeBNXnHTaTEXPsG3oCgE9 X2HciVqm45gpuh/eav4ulqVpH7d/hJ3zGuTd+Nikpy5FqOwvJI6JmQ22I12ju0M5/uZR jeZYeaRG1qBExoWVC33/iuyyZ++QvPW8bFgt1i2CoIm1qXBqZKKn0CVw8VKNPnH2A/5u w3+A== X-Received: by 10.224.13.19 with SMTP id z19mr38233656qaz.12.1372762362835; Tue, 02 Jul 2013 03:52:42 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.224.116.207 with HTTP; Tue, 2 Jul 2013 03:52:02 -0700 (PDT) In-Reply-To: <51D2AC78.3040206@beccati.com> References: <51CAB115.60602@beccati.com> <51D29355.9040807@beccati.com> <51D2AC78.3040206@beccati.com> Date: Tue, 2 Jul 2013 19:52:02 +0900 X-Google-Sender-Auth: KAKyTNWV-4pD5rBhwIbgzekd6jg Message-ID: To: Matteo Beccati Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0149ce04ffabeb04e08524c5 Subject: Re: [PHP-DEV] pgsql: Binary data support improvement From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0149ce04ffabeb04e08524c5 Content-Type: text/plain; charset=ISO-8859-1 Hi Matteo, 2013/7/2 Matteo Beccati > > > The API is not for ease of use, but for better performance as it eliminate > > needless hex conversions on both server and client side. > > What I meant is that we might have that speed improvements for free in > PDO when bytea is used as a parameter (i.e. most likely insert/updates). > With no visible change for the user and full backwards compatibility. libpq's query API only has flag that returns all result as binary or text. http://www.postgresql.org/docs/9.2/static/libpq-exec.html PGresult *PQexecParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char * const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat); resultFormat is the flag for returned values, binary or text. resultFormat Specify zero to obtain results in text format, or one to obtain results in binary format. (There is not currently a provision to obtain different result columns in different formats, although that is possible in the underlying protocol.) How it could be done while there isn't API in libpq? Does PDO pgsql driver use low level (protocol level) tweak? I'll check code later, but I don't have time for now. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0149ce04ffabeb04e08524c5--