在安装PostgreSQL时/ usr / lib /和/ usr / local /之间的区别?

时间:2015-07-14 07:05:33

标签: postgresql

我正在阅读这篇thread和PostgreSQL 9.4的手册。 我跑

ps auxw |  grep postgres | grep -- -D

但是

postgres 17340  0.0  0.5 226700 21756 ?        S    09:50   0:00 /usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf

但根据 file:///usr/share/doc/postgresql-doc-9.4/html/install-short.html /usr/local/pgsql/ >

initdb目录中的数据库可能是/usr/lib/

如何更改PostgreSQL的安装位置?

1 个答案:

答案 0 :(得分:2)

当您从源代码安装时,您正在阅读的帖子说安装目录是/usr/local/pgsql,所以我想这也是您所做的。要更改make install用于安装的目录,您需要为--prefix指定configure参数:

./configure --prefix=/path/to/install
make
sudo make install

PS:如果您没有从源代码安装,请参阅软件包管理器随附的文档。