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:

wget http://pqxx.org/download/software/libpqxx/libpqxx-4.0.tar.gz
tar xvfz libpqxx-4.0.tar.gz
cd libpqxx-4.0
./configure
make
make install

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

# IPv4 local connections:
host    all         all         127.0.0.1/32          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  ]
Advertisements