在CentOS上查找用于PostgreSQL 9.3的pgbench工具的位置。

4

我该如何安装postgresql 9.3的pgbench?

我已经在CentOS 64位上基本设置好了我的postgresql 9.3,并且它运行正常,没有任何问题。

然后我在我的CentOS机器上安装了postgresql93-contrib。但是我似乎没有pgbench?我得到了“command not found”(命令未找到)的错误提示?

我在bash下执行以下命令:

pgbench -i -U test test

有什么想法吗?

1
根据 此链接,pgbench 应该安装在 /usr/pgsql-9.3/bin/pgbench,你能检查一下这个文件是否存在吗?如果存在的话,只需要更正你的 PATH 即可。 - fvu
2个回答

7

这个功能在contrib库中,具体拼写取决于您使用的repo,类似于postgresql93-contrib

有可能pgbench不在您的默认路径中。那么您可以通过执行以下命令来运行它:/usr/pgsql-10/bin/pgbench --help


1
postgresql-contrib 是安装正确版本的软件包的通用名称。 - Brian Minton
1
在CentOS 7中,运行命令yum whatprovides pgbench会返回postgresql-contrib - juan.facorro

3

在CentOS6中

安装pgbench

yum install postgresql93-contrib

然后pgbench将出现在/usr/pgsql-9.3/bin中

将此路径添加到系统中

vi /etc/profile

将 /usr/pgsql-9.3/bin 添加到 Path 中

source /etc/profile

现在可以运行pgbench了。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接