Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) - Mailing list pgsql-interfaces

From Bruce Momjian
Subject Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
Date
Msg-id 200307082240.h68MenT06234@candle.pha.pa.us
Whole thread Raw
In response to DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)  (Rudy Lippan <rlippan@remotelinux.com>)
List pgsql-interfaces
I meant to say "Already applied by someone else --- not me".

---------------------------------------------------------------------------

Dominic Mitchell wrote:
> Tim Bunce wrote:
> > Ah, you're passing it the address of (probably temporary) reference.
> > It's the underlying object (which the ref points to) that you need.
> > 
> > Try something like:
> > 
> >   PQsetNoticeProcessor(imp_dbh->conn, pg_warn, (void *)SvRV(dbh));
> > 
> > the D_imp_dbh( (SV *)arg ) will do-the-right-thing *if* the
> > handle is the 'last handle used' ($DBI::lasth) whenever it's called.
> > 
> > That's probably not a safe assumption so you could try something
> > more like this:
> > 
> >     D_imp_dbh( sv_2mortal(newRV((SV*)arg)) );
> 
> Thank you!  This worked a treat.  It turned out that sv_2mortal() was 
> necessary after all.  I'm going to go away and read up on XS before I 
> try this sort of thing again, I think.
> 
> Could somebody with a commit bit for dbdpg please apply the attached 
> patch?  It passes all tests here on perl 5.8.0 / postgres 7.3.2.  I 
> don't think that it will cause any problems for other perl versions...

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-interfaces by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
Next
From: Adam Pigg
Date:
Subject: libpq:Find Table Name