How can I download, compile, make & install ONLY the libpq source on a server (Ubuntu) that DOES NOT have PostgreSQL installed?
I have found the libpq source here. However it does NOT seem to be separable from the entire PostgreSQL. Thanks in advance.
I DO NOT want to install the entire PostgreSQL. I want to use libpq as a C interface to PostgreSQL on a DIFFERENT server (also Ubuntu) that DOES have it installed.
I also found this old link which indicates that the above is POSSIBLE but not HOW to do it.
Besides downloading and configuration, the steps are:
These steps will give you the library and headers of
libpq
, and a binary calledpg_config
, and all postgresql backend headers, so that you could compile things likelibpqxx
correctly.(I've just tested with postgresql-9.6.5.)
It has to be configured with the entire source tree because that's what generates the necessary
Makefile
parts. But once configured,make
&&make install
can run inside thesrc/interfaces/libpq
directory alone, and the rest being left out completely.In steps:
tar xjf ~/Downloads/postgresql-9.4.1.tar.bz2
apt-get install libssl-dev
if it's not installed alreadycd postgresql-9.4.1; ./configure --with-openssl --without-readline
src/interfaces/libpq
and runmake
libpq
directory, run make install as root:sudo make install
.That will install into
/usr/local/pgsql
and subdirectories as a library independent and insulated from the one packaged in Ubuntu if it happens to be installed. To install it elsewhere, specify the location with the--prefix
option toconfigure
.