PDO_PGSQL improvements for 5.6

From: Date: Fri, 07 Mar 2014 15:52:26 +0000
Subject: PDO_PGSQL improvements for 5.6
Groups: php.internals 
Request: Send a blank email to internals+get-72992@lists.php.net to get a copy of this message
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. Thoughts? Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/

« previous php.internals (#72992) next »