Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73028 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19422 invoked from network); 9 Mar 2014 13:31:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2014 13:31:10 -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:43883] helo=mail.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/64-18839-B1D6C135 for ; Sun, 09 Mar 2014 08:31:08 -0500 Received: (qmail 23172 invoked from network); 9 Mar 2014 13:31:02 -0000 Received: from home.beccati.com (HELO ?192.168.1.202?) (88.149.176.119) by mail.beccati.com with SMTP; 9 Mar 2014 13:31:02 -0000 Message-ID: <531C6CF4.80108@beccati.com> Date: Sun, 09 Mar 2014 14:30:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: internals@lists.php.net References: <5319EB3A.2060404@beccati.com> In-Reply-To: <5319EB3A.2060404@beccati.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PDO_PGSQL improvements for 5.6 From: php@beccati.com (Matteo Beccati) On 07/03/2014 16:52, Matteo Beccati wrote: > Hi, > > I know I'm very late, but I really haven't had a chance until now. I do > have a few improvements for PDO_PGSQL that I'd really love to get into > PHP 5.6 if possible. They are about: > > 1. Cleaning up the #ifdef mess by raising the libpq requirements to > versions providing PQprepare, PQescapeStringConn, PQescapeByteaConn, > that is some 8.1.x / 8.2.x (which are way past EOL anyway). > > 2. Deprecate PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT which is > effectively equivalent to PDO::ATTR_EMULATE_PREPARES. There's no need to > keep and maintain both of them. > > 3. PQexecParams support. By default server side prepared statements are > used, which is a waste of time/resources in case the query has to be > executed just once. You can normally avoid that by using > PDO::ATTR_EMULATE_PREPARES, which is much faster, but forces PDO to > inline parameters in the queries. A newly introduced > PDO::PGSQL_ATTR_DISABLE_PREPARES will switch to use PQexecParams by > sending the query with placeholders and parameters separately, like > PQprepare does, without having to worry with the potential security > risks of ATTR_EMULATE_PREPARES. I haven't committed the changed to master either, in case someone has objections, but I've created a pull request for you to have a look: https://github.com/php/php-src/pull/619 I also haven't created RFCs as the changes are minimal and the deafault behaviour is unaffected (E_DEPRECATED aside). Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/