PostgreSQL – C/C++ Interface

Amarjeet wants to use PostgreSQL database for his project SIM. PostgreSQL is an Object Relational Database Management System with an emphasis on extensibility and standards-compliance. libpqxx library is used for its connection to C++. It is the official C++ client API for PostgreSQL database. It is available under BSD licence, so free to use. One can download the latest version from here and then follow the given steps:

tar xvfz libpqxx-4.0.tar.gz
cd libpqxx-4.0
make install

Now, find pg_hba.conf file in your PostgreSQL installation directory and add the following line:

# IPv4 local connections:
host    all         all          md5

We can start/restart postgres server in case it is not running using the following command:

[root@host]# service postgresql restart
Stopping postgresql service:                [  OK  ]
Starting postgresql service:                [  OK  ]