PostgreSQL cross server query?

╄→尐↘猪︶ㄣ 提交于 2020-01-03 16:58:11

问题


Is there a way that I might query a database located on "Server 2" and get my data in "Server 1" ? That is return a set of records from a remote server to my local one.

PS: Not cross database query on same server because I know how to do that with dblink.

Update: great ty.

http://www.postgresonline.com/journal/index.php?/archives/44-Using-DbLink-to-access-other-PostgreSQL-Databases-and-Servers.html works like a charm. My bust was that I didn't see it on the dblink documentation on postgresql website.


回答1:


Apparently dblink can be used to query other servers - Using DbLink to access other PostreSQL Databases and Servers




回答2:


this is old - these days one would use the postgres_fdw module instead: https://www.postgresql.org/docs/9.3/static/postgres-fdw.html



来源:https://stackoverflow.com/questions/2856399/postgresql-cross-server-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!