10

I'm trying to get it installed and use in ubuntu. Was following this page to install the additional instrumentation packages.

Install Server Instrumentation for Postgresql 8.4
To install Server Instrumentation for Postgresql 8.4 you may use the command line and type:
 sudo apt-get install postgresql-contrib

Run the adminpack.sql script, simply type:
 sudo -u postgres psql < /usr/share/postgresql/8.4/contrib/adminpack.sql

But I couldn't find adminpack.sql in 9.1 version.

1

4 Answers 4

24

In PostgreSQL 9.1 and later, extensions can be installed via the CREATE EXTENSION command:

sudo -u postgres psql
CREATE EXTENSION "adminpack";
0
4

Try locate adminpack. But first, run updatedb to make sure the locate database is up to date.

sudo updatedb
locate adminpack

The output is:

/usr/lib/postgresql/9.1/lib/adminpack.so
/usr/share/postgresql/9.1/extension/adminpack--1.0.sql
/usr/share/postgresql/9.1/extension/adminpack.control
5
  • locate doesn't find any file.
    – John Eipe
    May 9, 2012 at 18:04
  • Did you see in /usr/lib/postgresql/9.1/extension?
    – Jan Marek
    May 10, 2012 at 9:05
  • there are only 2 folders within 9.1 folder - bin and lib
    – John Eipe
    May 10, 2012 at 16:04
  • 1
    Try pkg -L postgresql-contrib-9.1 and you will see, what files are installed and where.
    – Jan Marek
    May 11, 2012 at 7:58
  • If upon sudo updatedb you get updatedb: command not found, install locate first Feb 18, 2013 at 0:03
4

Looks like this is old and comments are closed, so I'm opening another answer.

ldalonzo's answer is correct once you have all the components, but I found I also had to run:

sudo apt-get install postgresql-contrib-9.1

Looks like the bare postgresql package doesn't include the additional modules.

2

Once you install postgresql-contrib using below command

sudo apt-get install postgresql-contrib

Adminpack is located in the below path

/usr/share/postgresql/9.1/extension/adminpack--1.0.sql

To load the adminpack use the below command

sudo su postgres -c psql < /usr/share/postgresql/9.1/extension/adminpack--1.0.sql

Then

sudo /etc/init.d/postgresql restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.