Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22598 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78960 invoked by uid 1010); 27 Mar 2006 16:25:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78945 invoked from network); 27 Mar 2006 16:25:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2006 16:25:59 -0000 X-Host-Fingerprint: 87.123.91.145 i577B5B91.versanet.de Received: from ([87.123.91.145:21490] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 1D/93-37235-61218244 for ; Mon, 27 Mar 2006 11:25:59 -0500 To: internals@lists.php.net,Yasuo Ohgaki Message-ID: <44281210.3000103@php.net> Date: Mon, 27 Mar 2006 18:25:52 +0200 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 References: <4425040E.60402@ohgaki.net> <44250532.7070509@php.net> <44275330.7050508@ohgaki.net> <44279BCB.1090105@php.net> <44280F96.3090600@ohgaki.net> In-Reply-To: <44280F96.3090600@ohgaki.net> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Posted-By: 87.123.91.145 Subject: Re: [PHP-DEV] Re: pg_execute error From: lsmith@php.net (Lukas Smith) Yasuo Ohgaki wrote: > Lukas Smith wrote: >> Just to make it clear: calling pg_execute() on a not yet prepared >> statement will cause your transaction to be rolled back on the next >> commit. Encouraging the use of pg_execute() to find out of the statement >> has been prepared is therefore wrong. >> >> Moreover by your logic we would need to remove E_WARNING's from php >> entirely. Finally you can detect if a function call was called with >> error suppression in your error handler and that is the appropriate >> place to address your issue. > > This issue is like file_exists() raises E_ERROR, since > PostgreSQL does not provide means to check if plan is > already defined. i.e. design error for the function. > > Even if PostgreSQL provide view for already defined plans, > selecting the view to check requires. It requires overheads > which requires network traffic. Thus adding new feature to > check if plan is defined is not good idea. > i.e. DB is usually a bottle neck of web systems. So why dont you just do @pg_execute() and in your error handler you can do: function ErrorHandler($errno, $errstr, $errfile, $errline) { // ignore silenced function calls if (!error_reporting()) { return; } .. If you want a "beautiful" solution you will have to manage your prepared statements in some persistant layer. regards, Lukas