PostgreSQL 跨服务器查询?
Posted
技术标签:
【中文标题】PostgreSQL 跨服务器查询?【英文标题】:PostgreSQL cross server query? 【发布时间】:2010-05-18 10:39:17 【问题描述】:有没有一种方法可以查询位于“服务器 2”上的数据库并在“服务器 1”中获取我的数据?那就是将一组记录从远程服务器返回到我的本地服务器。
PS:不要在同一台服务器上进行跨数据库查询,因为我知道如何使用 dblink。
更新: 太棒了。
http://www.postgresonline.com/journal/index.php?/archives/44-Using-DbLink-to-access-other-PostgreSQL-Databases-and-Servers.html 就像一个魅力。我的失败是我没有在 postgresql 网站上的 dblink 文档中看到它。
【问题讨论】:
Possible to perform cross-database queries with postgres?的可能重复 【参考方案1】:这是旧的 - 现在人们会使用 postgres_fdw 模块:https://www.postgresql.org/docs/9.3/static/postgres-fdw.html
【讨论】:
我建议把正确答案改成这个——这对今天来说更相关和正确。【参考方案2】:显然dblink可以用来查询其他服务器-Using DbLink to access other PostreSQL Databases and Servers
【讨论】:
以上是关于PostgreSQL 跨服务器查询?的主要内容,如果未能解决你的问题,请参考以下文章