Problem scenario: You have C++ and Postgres installed on an Ubuntu Linux server. How do you write C++ programs to retrieve data from Posgres databases?
Solution
Install the official C++ API for Postgresql. These directions should work on any Debian distribution of Linux.
As root, do the following from the Linux command prompt:
apt-get -y install libpq-dev g++
cd /usr/bin/
curl http://pqxx.org/download/software/libpqxx/libpqxx-4.0.tar.gz >
…
Continue reading “How Do You Use C++ to Retrieve Data from a PostgreSQL Database on Ubuntu Linux?”