Monday, October 18, 2010

Install dblink from contrib in Postgres 8.4

0 comments
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  dblink.so '/var/lib/pgsql84/lib/dblink.so'
/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'
------

ls
dblink.c  dblink.h  dblink.o  dblink.so  dblink.sql  dblink.sql.in  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=10.0.0.51 port=5432 dbname=testdb user=testuser password=testpwd');

Leave a Reply

Labels