Linux 为 Postgres 9 安装 DBLink
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5075193/
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
Installing DBLink for Postgres 9
提问by Matty Bear
Can someone please shed some light on how to install the requirements for Postgres 9 (Centos) to be able to use dblink for inter-postgres db querying.
有人可以解释一下如何安装 Postgres 9 (Centos) 的要求,以便能够使用 dblink 进行 postgres 间的数据库查询。
There seems to be no clean documentation out there on how to install dblink requirements in general.
似乎没有关于如何安装 dblink 要求的完整文档。
Thanks in advance.
提前致谢。
采纳答案by Ian Gow
Install DbLink DbLink is located in share/contribs/dblink.sql of your PostgreSQL install.To use it, load the dblink.sql file in the database you would like to use it in.
安装 DbLink DbLink 位于 PostgreSQL 安装的 share/contribs/dblink.sql 中。要使用它,请在要使用它的数据库中加载 dblink.sql 文件。
来源:http: //www.postgresonline.com/journal/archives/44-Using-DbLink-to-access-other-PostgreSQL-Databases-and-Servers.html
回答by Mike T
If you have PostgreSQL 9.1 (or later), make sure the contrib package is installed, e.g., from your shell:
如果您有 PostgreSQL 9.1(或更高版本),请确保安装了 contrib 包,例如,从您的 shell:
yum install postgres*contrib
Then within the database, use the DDL to create the extension:
然后在数据库中,使用 DDL 创建扩展:
CREATE EXTENSION dblink;