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 2D620925C70 for ; Fri, 30 May 2003 12:21:35 -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 33736-06 for ; Fri, 30 May 2003 12:21:34 -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 18489925B3B for ; Fri, 30 May 2003 12:21:34 -0400 (EDT) Received: (qmail 57411 messnum 566428 invoked from network[159.134.165.52/p308.as1.limerick1.eircom.net]); 30 May 2003 16:21:31 -0000 Received: from p308.as1.limerick1.eircom.net (HELO dansat.data-plan.com) (159.134.165.52) by mail05.svc.cra.dublin.eircom.net (qp 57411) with SMTP; 30 May 2003 16:21:31 -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 h4UGLW2f025786; Fri, 30 May 2003 17:21:32 +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 h4UGLLcZ025785; Fri, 30 May 2003 17:21:21 +0100 (BST) Date: Fri, 30 May 2003 17:21:21 +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: <20030530162121.GA6818@dansat.data-plan.com> References: <3ED5CC25.70102@semantico.com> <20030530090401.GG6818@dansat.data-plan.com> <3ED7224B.7030101@semantico.com> <20030530140313.GP6818@dansat.data-plan.com> <3ED766F0.2070707@semantico.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ED766F0.2070707@semantico.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200306/6 X-Sequence-Number: 4217 On Fri, May 30, 2003 at 03:13:04PM +0100, Dominic Mitchell wrote: > Tim Bunce wrote: > >On Fri, May 30, 2003 at 10:20:11AM +0100, Dominic Mitchell wrote: > >>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. > > Well, we're calling PQsetNoticeProcessor[1], from inside dbd_db_login, > so I should be able to pass in imp_dbh as the "arg" argument. The bit > that I wasn't sure about before was what to cast it to in order to > retrieve it from a void *. You could always cast it to a void * :-) > >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. > > How will that work? Is that for any sort of asynchronous message from > the database? That kind of thing, yes, plus 'success with info' and anything else a driver wants to comminucate back to an app 'out of band'. The tricky part will be categorizing the types of events to make it usefully portable. But I don't want to start that thread just yet, so ignore me! > >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. > > It does, I just couldn't figure it out in the 30 minutes I spent looking > at it. I need to go back and spend more time with the docs and less > being lazy. :-) > > -Dom > > [1] Damn mozilla for not being emacs[2]. I want dynamic-abbrevs! > [2] Or vim. That does it too. I use mutt and so edit messages in vim. Works well for me. Tim.