Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22591 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72272 invoked by uid 1010); 27 Mar 2006 08:01:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 72256 invoked from network); 27 Mar 2006 08:01:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2006 08:01:31 -0000 X-Host-Fingerprint: 212.112.227.169 ipx11223.ipxserver.de Linux 2.5 (sometimes 2.4) (4) Received: from ([212.112.227.169:38037] helo=ipx11223.ipxserver.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 98/D7-37235-BDB97244 for ; Mon, 27 Mar 2006 03:01:31 -0500 Received: from localhost (localhost [127.0.0.1]) by ipx11223.ipxserver.de (Postfix) with ESMTP id EDFB6DF0084; Mon, 27 Mar 2006 10:01:21 +0200 (CEST) Received: from ipx11223.ipxserver.de ([127.0.0.1]) by localhost (ipx11223 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20732-07; Mon, 27 Mar 2006 10:01:10 +0200 (CEST) Received: from [127.0.0.1] (i577B5B91.versanet.de [87.123.91.145]) by ipx11223.ipxserver.de (Postfix) with ESMTP id 0F9DCDF0043; Mon, 27 Mar 2006 10:01:10 +0200 (CEST) Message-ID: <44279BCB.1090105@php.net> Date: Mon, 27 Mar 2006 10:01:15 +0200 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Yasuo Ohgaki Cc: internals@lists.php.net References: <4425040E.60402@ohgaki.net> <44250532.7070509@php.net> <44275330.7050508@ohgaki.net> In-Reply-To: <44275330.7050508@ohgaki.net> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: by somedaemon at backendmedia.com Subject: Re: pg_execute error From: lsmith@php.net (Lukas Smith) Yasuo Ohgaki wrote: > Lukas Smith wrote: >> Yasuo Ohgaki wrote: >> >>> 3) add bool parameter to pg_execute() >>> e.g. pg_execute(resource connection, string stmtname, array params, bool ignore_error) >> how would you intent to implement this? >> AFAIK there is currently no catalog to find out the prepared statements >> in the current sessions (I hear 8.2 will change this). So the only way >> to find out is to simply "try it" and cause an error in the session >> which could trigger all sorts of error handlers on the database side .. >> something I would not expect from calling a php function like this. > > I hear about that. > > Current pg_execute raise E_WARNING if plan is not prepared. > The error is annoying since programmers has to try and > see if it works. > > Anyway, since there are no other comments, I'll get rid of > the error from pg_execute. Since this is the most efficient > way. 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. regards, Lukas