Re: PDO PgSQL: _pdo_pgsql_notice

From: Date: Wed, 07 Oct 2009 11:30:43 +0000
Subject: Re: PDO PgSQL: _pdo_pgsql_notice
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-45687@lists.php.net to get a copy of this message
On Wed, Oct 7, 2009 at 1:27 PM, Samuel ROZE <samuel.roze@aliceadsl.fr> wrote: > Le mercredi 07 octobre 2009 à 09:06 +0200, Matteo Beccati a écrit : >> From what I could see, things get a bit more complicate on the code side: >> >> PgSQL: >> 1. Set a notice processor callback >> 2. Clear the notice buffer before a query >> 3. Asynchronously buffer notices inside the callback >> 4. Set a no-op processor callback >> >> MySQL: >> 1. Call mysql_warning_count() after a succesful query >> 2. if the result is non-zero, execute "SHOW WARNINGS" and fetch the results >> >> Oracle: >> 1. Enable output buffering >> 2. Fetch the buffer after a successful query >> 3. Clear the buffer >> 4. Disable output buffering >> >> Adding generic hooks/functions will also require a PDO API version bump. > > 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. Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org

« previous php.internals (#45687) next »