10

我正在尝试安装它并在 ubuntu 中使用。正在关注页面以安装其他仪器包。

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

但我在 9.1 版本中找不到 adminpack.sql。

4

4 回答 4

24

在 PostgreSQL 9.1 及更高版本中,可以通过以下CREATE EXTENSION命令安装扩展:

sudo -u postgres psql
CREATE EXTENSION "adminpack";
于 2012-06-18T22:57:21.153 回答
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.

于 2013-07-28T23:13:39.960 回答
4

试试locate adminpack。但首先,运行updatedb以确保locate数据库是最新的。

sudo updatedb
locate adminpack

输出是:

/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
于 2012-05-09T09:35:42.420 回答
2

使用以下命令安装 postgresql-contrib 后

sudo apt-get install postgresql-contrib

Adminpack 位于以下路径

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

要加载 adminpack,请使用以下命令

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

然后

sudo /etc/init.d/postgresql restart
于 2013-10-10T03:34:57.620 回答