Monday, October 18, 2010

Install dblink from contrib in Postgres 8.4

Postgresql 8.4.4 was installed from source at /var/lib/pgsql84, where all the source files were at /root/postgresql-8.4.4.
To install dblink module from contrib, I followed the steps:

cd /root/postgresql-8.4.4/contrib/dblink
make install
/bin/sh ../../config/mkinstalldirs '/var/lib/pgsql84/lib'
mkdir -p -- /var/lib/pgsql84/share/contrib
/bin/sh ../../config/install-sh -c -m 755 '/var/lib/pgsql84/lib/'
/bin/sh ../../config/install-sh -c -m 644 ./uninstall_dblink.sql '/var/lib/pgsql84/share/contrib'
/bin/sh ../../config/install-sh -c -m 644 dblink.sql '/var/lib/pgsql84/share/contrib'

dblink.c  dblink.h  dblink.o  dblink.sql  expected  Makefile  sql  uninstall_dblink.sql

Now dblink.sql was executed in order to create the required functions in template1 database.

/var/lib/pgsql84/bin/psql -U postgres84 template1 -f dblink.sql
/var/lib/pgsql84/bin/psql -U postgres84 template1
select dblink_connect('statcollector51','hostaddr= port=5432 dbname=testdb user=testuser password=testpwd');

Leave a Reply