pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Bunce <Tim.Bunce@pobox.com>
To: Dominic Mitchell <dom@semantico.com>
Cc: Tim Bunce <Tim.Bunce@pobox.com>
Cc: Rudy Lippan <rlippan@remotelinux.com>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: David Wheeler <david@wheeler.net>
Cc: pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>
Subject: Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
Date: Fri, 30 May 2003 17:21:21 +0100
Message-ID: <20030530162121.GA6818@dansat.data-plan.com> (raw)
In-Reply-To: <3ED766F0.2070707@semantico.com>
References: <Pine.LNX.4.44.0305290446550.26451-100000@elfride.ineffable.net>
	<3ED5CC25.70102@semantico.com>
	<20030530090401.GG6818@dansat.data-plan.com>
	<3ED7224B.7030101@semantico.com>
	<20030530140313.GP6818@dansat.data-plan.com>
	<3ED766F0.2070707@semantico.com>

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.



view thread (18+ messages)  latest in thread

Message-ID: <20030530162121.GA6818@dansat.data-plan.com>
Permalink:  ../20030530162121.GA6818@dansat.data-plan.com/
Also on:    postgresql.org/message-id/20030530162121.GA6818@dansat.data-plan.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: Tim.Bunce@pobox.com, dom@semantico.com, rlippan@remotelinux.com, pgman@candle.pha.pa.us, david@wheeler.net, dbi-dev@perl.org
  Subject: Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  In-Reply-To: <20030530162121.GA6818@dansat.data-plan.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox