pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Dominic Mitchell <dom@semantico.com>
Cc: Tim Bunce <Tim.Bunce@pobox.com>
Cc: Rudy Lippan <rlippan@remotelinux.com>
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: Tue, 8 Jul 2003 18:40:49 -0400 (EDT)
Message-ID: <200307082240.h68MenT06234@candle.pha.pa.us> (raw)
In-Reply-To: <3EDB7F17.7010607@semantico.com>


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, Pennsylvania 19073



view thread (18+ messages)

Message-ID: <200307082240.h68MenT06234@candle.pha.pa.us>
Permalink:  ../200307082240.h68MenT06234@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200307082240.h68MenT06234@candle.pha.pa.us

 · 

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: pgman@candle.pha.pa.us, dom@semantico.com, Tim.Bunce@pobox.com, rlippan@remotelinux.com, david@wheeler.net, dbi-dev@perl.org
  Subject: Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  In-Reply-To: <200307082240.h68MenT06234@candle.pha.pa.us>

* 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