如何在现有数据库中安装 postgresql-contrib 模块?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12883010/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I install the postgresql-contrib module in an existing database?
提问by djq
I'm using postgresql 9.1.6
on CentOS. I would like to install the postgresql-contribmodule using a binary file, but I can't find it online. I'm unsure if I can install this after already installing postgresql
. Is it possible to do this?
我postgresql 9.1.6
在 CentOS 上使用。我想使用二进制文件安装postgresql-contrib模块,但我在网上找不到它。我不确定在已经安装postgresql
. 是否有可能做到这一点?
I installed postgresql
in the following way:
我postgresql
通过以下方式安装:
wget http://ftp.postgresql.org/pub/source/v9.1.6/postgresql-9.1.6.tar.gz
tar -xzf postgresql-9.1.6.tar.gz
cd postgresql-9.1.6./configure --prefix=$HOME
make
make install
I am currently using the databases within this install and would prefer not to reinstall it (if possible).
我目前正在此安装中使用数据库,并且不想重新安装它(如果可能)。
I understand that once I install this I can use a function in the following way:
我知道一旦我安装了它,我就可以通过以下方式使用一个函数:
create extension tablefunc ;
EDIT: If I followed the instructions from here, does gmake
and gmake install
affect an existing database?
编辑:如果我跟着从说明这里,并 gmake
和gmake install
影响现有的数据库?
回答by Smith
You might be hard pressed to find the contrib modules as binary distributions; however, the very page you linked has explicit instructions on how to build the contrib modules:
您可能很难找到作为二进制发行版的 contrib 模块;但是,您链接的页面有关于如何构建 contrib 模块的明确说明:
When building from the source distribution, these modules are not built automatically. You can build and install all of them by running
从源代码分发构建时,这些模块不会自动构建。您可以通过运行来构建和安装所有这些
gmake
gmake install
in the contrib directory of a configured source tree; or to build and install just one selected module, do the same in that module's subdirectory.
在配置的源树的 contrib 目录中;或者只构建和安装一个选定的模块,在该模块的子目录中执行相同的操作。
Alternatively, you could try using yum (the package is postgresql-contrib.x86_64), but I can't vouch for the results of this if you installed Postgres from source.
或者,您可以尝试使用 yum(该软件包是 postgresql-contrib.x86_64),但如果您从源代码安装 Postgres,我无法保证此结果。