Libpq vs Libpqxx
Libpq is the C application programmer's interface to PostgreSQL and Libpqxx is the C++ application programmer's interface to PostgreSQL. Libpqxx actually wraps the functions in Libpqxx. Libpqxx is slower than Libpq and Libpqxx 2.6.9 is not compatible with PostgreSQL 8.3 and GCC 4.1.x on Red Hat / Fedora 5.
After using Libpqxx for the past 5 years on a PostgreSQL 7.4 database, I migrated the PostgreSQL 7.4 database to 8.3 and Libpqxx to the current stable version - 2.6.9.
We are running dual quad core xeon's on a 64 bit Red Hat Entrprise 5 Server with GCC 4.1.x. Libpqxx is just a wrapper library around Libpqx so there are performance issues because you can just call into libpq directly without incurring object / template overhead in your code. There are io errors in the libpqxx classes for insertion statements - i.e. improper object destruction and improper transaction destruction - thereby causing memory leaks. I turned on DEBUG5 in the postgreSQL 8.3 database and closely monitored the log files. After deciding to migrate the code to use libq, I was very pleased with the results. Error checking is simple, code execution is faster, and library / executable sizes were reduced. If you are not married to C++ objects, then I highly recommend replacing libpqxx with libpq in your C++ code. The conversion is simple. Please e-mail me for examples if you are interested.

