Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45696 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84750 invoked from network); 7 Oct 2009 14:24:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2009 14:24:43 -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 213.92.90.60 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 213.92.90.60 ispeed-srv6.housing.tomato.it Received: from [213.92.90.60] ([213.92.90.60:56652] helo=mail.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/6D-13083-37C9CCA4 for ; Wed, 07 Oct 2009 09:49:40 -0400 Received: (qmail 76921 invoked from network); 7 Oct 2009 15:49:37 +0200 Received: from unknown (HELO ?192.168.1.201?) (matteo@beccati.com@88.149.176.119) by mail.beccati.com with SMTP; 7 Oct 2009 13:49:37 -0000 Message-ID: <4ACC9C53.9040200@beccati.com> Date: Wed, 07 Oct 2009 15:49:07 +0200 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Pierre Joye CC: Samuel ROZE , Christopher Jones , Lukas Kahwe Smith , PHP Internals References: <1254806557.19561.3.camel@samuel-laptop> <1254894205.7418.32.camel@samuel-laptop> <4ACC2B8F.2040302@oracle.com> <4ACC2E8F.8040903@beccati.com> <4ACC2F62.4050601@oracle.com> <4ACC30A3.8030205@beccati.com> <4ACC32E1.6070909@oracle.com> <4ACC3DDE.8020905@beccati.com> <1254914836.7418.52.camel@samuel-laptop> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PDO PgSQL: _pdo_pgsql_notice From: php@beccati.com (Matteo Beccati) Pierre Joye ha scritto: > On Wed, Oct 7, 2009 at 1:27 PM, Samuel ROZE wrote: >> This is a bit complicated and very different ! Actually, each database >> works as it want and it may be better to use different functions for >> each driver. > > That defeats the whole purpose of PDO. The meaning of each message > will indeed different, but if one needs to call different APIs for > each driver, I doubt anyone will ever use them. Quoting my chat with Rasmus in Verona earlier this year: "PDO is a database driver abstraction layer, not a database abstraction layer", or something along the lines, but I see your point ;) However, I've been thinking about this a bit more and I think that the different "message" meanings can be summarised like this: * MySQL raises warnings, esp. when not running in strict mode * Oracle uses them as a custom way to deliver messages/data * PostgreSQL being a bit of both worlds: informational + custom By all means, I like the idea of a unified "message" API, but do we really need the syntactic sugar (and development effort)? MySQL and Oracle drivers can already access them with a standard PDO::query() call. Only PgSQL notices require a special treatment because they are currently discarded. I guess this is becoming more philosophical question: is the base PDO class intended to only have common and portable functionalities and leve everything else to the drivers or should it also try and group other similar features to be more consistent even though not likely to be portable? Also I guess that mixing and matching names could be confusing: an experienced Oracle developer using "dbms_output" would hardly imagine that they can be fetched by calling getMessages() just by taking a quick look to the documentation. Same goes for a Postgres developer who can easily understand what pg_last_notice() does and would probably not associate the familiar notice concept with getMessages. Sorry for the long post, it's just my 2 cents. Cheers -- Matteo Beccati