X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id A318D921B36 for ; Fri, 30 May 2003 10:03:36 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 02891-01 for ; Fri, 30 May 2003 10:03:31 -0400 (EDT) Received: from mail05.svc.cra.dublin.eircom.net (mail05.svc.cra.dublin.eircom.net [159.134.118.21]) by developer.postgresql.org (Postfix) with SMTP id 0ACCB921B33 for ; Fri, 30 May 2003 10:03:31 -0400 (EDT) Received: (qmail 34968 messnum 302054 invoked from network[159.134.164.239/p239.as1.limerick1.eircom.net]); 30 May 2003 14:03:24 -0000 Received: from p239.as1.limerick1.eircom.net (HELO dansat.data-plan.com) (159.134.164.239) by mail05.svc.cra.dublin.eircom.net (qp 34968) with SMTP; 30 May 2003 14:03:24 -0000 Received: from dansat.data-plan.com (localhost [127.0.0.1]) by dansat.data-plan.com (8.12.6/8.12.6) with ESMTP id h4UE3O2f024041; Fri, 30 May 2003 15:03:24 +0100 (BST) (envelope-from timbo@dansat.data-plan.com) Received: (from timbo@localhost) by dansat.data-plan.com (8.12.6/8.12.6/Submit) id h4UE3EtU024040; Fri, 30 May 2003 15:03:14 +0100 (BST) Date: Fri, 30 May 2003 15:03:13 +0100 From: Tim Bunce To: Dominic Mitchell Cc: Tim Bunce , Rudy Lippan , Bruce Momjian , David Wheeler , pgsql-interfaces@postgresql.org, "'DBI developers'" Subject: Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Message-ID: <20030530140313.GP6818@dansat.data-plan.com> References: <3ED5CC25.70102@semantico.com> <20030530090401.GG6818@dansat.data-plan.com> <3ED7224B.7030101@semantico.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ED7224B.7030101@semantico.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200306/4 X-Sequence-Number: 4215 On Fri, May 30, 2003 at 10:20:11AM +0100, Dominic Mitchell wrote: > Tim Bunce wrote: > >On Thu, May 29, 2003 at 10:00:21AM +0100, Dominic Mitchell wrote: > > > >>One more thing for the change log: notice messages generated by the > >>database now use the perl warning mechanism instead of going to stderr, > >>so they can be trapped if needed. > > > > > >Hopefully implemented as > > > > if (DBIc_WARN(imp_xxh)) > > warn("...", ...) > > > >The $h->{Warn} attribute defaults to true. Can be useful to silence > >warnings for a handle without having to play games with $SIG{__WARN__}. > > See, I told you I wasn't an XS guru. :-) > > Actually, I looked at this, but my limited C and DBI skills couldn't > work out a) what the required handle was (probably dbh) Just whatever handle was used to call the method that's generating the warning. > and b) how to pass that into the PQsetNoticeProcessor function as data > and get it out again. Ah, different issue. For that I'd say if DBIc_WARN(imp_xxh) isn't true then disable the PQsetNoticeProcessor function. > I'll happily take another look though, now that it's been brought up as > desirable. Actually I'd misunderstood the circumstances of the warn (not reading your message carefully enough). For notice messages generated by the database server they'll soon(ish) be a $h->{HandleEvent} = sub { ... } hook that should be used. But that'll bring you back to needing some way for the PQsetNoticeProcessor function to get at the handle data it'll need to pass to the HandleEvent hook. The PQsetNoticeProcessor API ought to allow you to some way to do that. Tim.