Hi, We have an application which was originally coded completely in perl, however as the quantity of data being handled grew, we found it necessary to recode parts of it in C++ for efficiency.
In particular, the part of the code which loads the database was originally pure perl but was re-written so that the perl component issues a COPY statement, then hands over the database connection to the C++ component, which then sends the data to the database. An XS module provides an interface the high speed C++ loading code. The perl code passes the DBI handle to the XS module which then has to extract the PQConn handle in order to send data to it. It all works OK, except that there doesn't seem to be a way to access the PQConn pointer within the imp_dbh_st, other than including dbdimp.h - which is risky in case our XS module gets compiled against a different DBD::Pg version to the one that is actually on the server at runtime. I was wondering if anyone else has ever come across this issue and if so how they solved it? One idea would be to provide an access to the PQConn handle - either via a database handle attribute, or some C function one could call. If we made a patch like that would it be likely to be accepted? Or would exposing the underlying database connection be considered bad form? Thanks in advance, Regards Mike
