Postgres中不同数据库间无法直接访问,比如有数据库test1和test2,每个数据库中都有一个表为tablea;我使用的操作系统为win8.1,postgres版本为9.3.6;使用pgAdminIII工具访问postgres;
分别在两个数据库(test1,test2)中创建tablea;
test1数据库创建tablea并插入数据:
create table tablea(id int,name varchar(10));
insert into tablea values
(1,’a’),(2,’b’);
test2数据库创建tablea并插入数据:
create table tablea(id int,name varchar(10));
insert into tablea values
(1,’c’),(2,’d’);
从test1数据库中分别访问test1和test2数据库中的表