The same machine to a Pg service, there are two Pg database, how to realize the

So, there is a PostgreSQL database service on a single machine, two data of db1, DB2, db1
How to access the data inside DB2, use the SQL statement to the operation, online for a long time do not know how to access,
Said the use of dblink also don't know how to use, the environment is Windows2008r2 Pg9.2.2, who can
To answer, thank you!

Started by Luke at June 29, 2016 - 9:34 AM

Or to use db_link
Need to perform
create extension dblink;

DB2 login
select dblink_connect('myconn','dbname=db1 host=localhost user=db1 password=db1');

select * from dblink('myconn','select count(*) from tab1') as t(a int);
SELECT * FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[]);

Posted by Luke at July 06, 2016 - 10:33 AM

FDW also said the good.

Posted by Newman at July 14, 2016 - 10:56 AM

Use either DBLINK, or SCHEMA,

Posted by Beacher at July 23, 2016 - 11:53 AM

Like postgresql9.3 to solve this problem

Posted by Luke at July 28, 2016 - 12:17 PM

Pg9.2 also supports the postgres_fdw. We have the line with the

Posted by Ken at July 31, 2016 - 1:01 PM