Newsgroups: php.internals,php.pdo Path: news.php.net Xref: news.php.net php.internals:50099 php.pdo:481 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63766 invoked from network); 4 Nov 2010 03:49:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2010 03:49:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=ssufficool@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ssufficool@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ssufficool@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:57364] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/02-46367-A2D22DC4 for ; Wed, 03 Nov 2010 22:48:59 -0500 Received: by qwj8 with SMTP id 8so819618qwj.29 for ; Wed, 03 Nov 2010 20:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=vSXjxu3hTBYCfXcnJmWnjiQFwxyVMeut9bgcVRhuvpw=; b=MvV/mMH0H6+0FaWGj44Nr7dkydPG5TnOI6islo1MGUXnQMCA+isxfbv38mYDkqwNcc S/imb4boxxiFm1ADA5lgavdxkSm+hYBfDUu5mbF+ja97sIfG3IjdRwlfwY+3hdOItIKu 7Mc0rZyZ1mUGqyRCysLLEseiVCqC26qD9yhaY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=w2wquPalX2iUfPhVv45Ry437HhX6NJrCOuB3AHRySn4JwrOeSOKnheNdMaCaKsvwsr l2oeTUV/B9h8cHeHgEsXy12nBA1FLDbcB1k0CQEA16QYA4BZOUoBx2x7Uc1eHlnfdwtq HwAulEkZbLkgyY0Hh49iYJ+jf/hh8tFaPaiyM= MIME-Version: 1.0 Received: by 10.224.207.195 with SMTP id fz3mr103737qab.355.1288842536310; Wed, 03 Nov 2010 20:48:56 -0700 (PDT) Received: by 10.220.172.202 with HTTP; Wed, 3 Nov 2010 20:48:56 -0700 (PDT) In-Reply-To: <96B72336-79FE-4243-99F7-86A5815208F6@gmail.com> References: <96B72336-79FE-4243-99F7-86A5815208F6@gmail.com> Date: Wed, 3 Nov 2010 20:48:56 -0700 Message-ID: To: Wez Furlong Cc: PHP Developers Mailing List , pdo Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PDO] PDO_DBLIB Native PHP Type binding From: ssufficool@gmail.com (Stanley Sufficool) On Wed, Nov 3, 2010 at 8:25 PM, Wez Furlong wrote: > > On Nov 3, 2010, at 9:52 PM, Stanley Sufficool wrote: > >> Before I gut PDO_DBLIB one more time to implement native parameter >> binding for stored procedures, what are the thoughts on returning the >> column values from the database as the native PHP type when possible? >> Currently everything is returned as a string, incurring overhead for >> conversion > > The design philosophy was to pull the data out as strings as this gives the > highest data fidelity (especially with the various numeric types) and is a > pragmatic choice for the majority of web apps which are largely in text land > anyway, and typically are not bottlenecked on the performance of converting > database column values. > > Some drivers, particularly postgres, are unable to request string data and > therefore return their results in the type that most closely matches the C > datatype forced on it by the API. > > This has been a source of complaints from some about the consistency of the > returned data for apps that are designed to run against multiple database > backends. > > I would advise against changing the behavior of the driver if possible, and > against changing it away from the established stringiness of PDO without > good reason. One reason was to bring the driver in line with the behavior of the PDO sqlserv driver ( http://msdn.microsoft.com/en-us/library/cc296193.aspx ) Eventually I would like yo make the 2 interchangeable and have PHP/PDO applications run the same on Win32 and Linux. > >> and creating problems hinting at the desired binding type >> for BLOBS and numeric data types. Yes, you are right. I can bind columns as strings and parameters as a specific data type independently. > > Can you elaborate on this? You can explicitly set the desired binding via > bindColumn. > > --Wez. >