And fix it to have a 'pg_' prefix I trust :)
Also there's no need to the Pg.xs vs dbdimp.c split.
Custom code can go straight into Pg.xs.
Tim.
On Thu, Jun 27, 2002 at 06:05:46PM -0700, Jeffrey Baker wrote:
> On Thu, Jun 13, 2002 at 07:35:23AM -0400, [EMAIL PROTECTED] wrote:
> > Its a fairly small change to add this, 10 lines of code. I wrote this
> > patch for a previous place, unfortunately I no longer work with Pg
> > regularly, and don't have time to clean it up and give you a proper patch
> >
> > The interface is $pid=$dbh->func('backend_pid')
> >
> > Unfortunately, I don't work with Pg often enough, but this should get you
> > started:
> > in Pg.xs:
> >
> > +void
> > +backend_pid(dbh)
> > + SV * dbh
> > + CODE:
> > + D_imp_dbh(dbh);
> > +
> > + ST(0) = dbd_db_backend_pid(dbh, imp_dbh);
> >
> > In dbdimp.c:
> >
> > +int
> > +dbd_db_backend_pid (dbh, imp_dbh)
> > + SV *dbh;
> > + imp_dbh_t *imp_dbh;
> > +{
> > + char id;
> > + SV* retsv;
> > +
> > + if (dbis->debug >= 1) { fprintf(DBILOGFP, "dbd_db_backend_pid\n"); }
> > +
> > + return PQbackendPID(imp_dbh->conn);
> > +}
> >
> >
> > Good luck. Once it works, submit it to maintainer, will ya? ;)
>
> This looks pretty good already, although I have no intention of
> exposing the entire PQ API via the DBD. I'll take this one since
> someone actually asked for it.
>
> -jwb