Skip site navigation (1) Skip section navigation (2)

Re: Multidatabase query

From: Vibhor Kumar <vibhor(dot)aim(at)gmail(dot)com>
To: Mauro Bertoli <bertoli(dot)mauro(at)yahoo(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multidatabase query
Date: 2009-03-27 23:57:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Hi Mauro,

Not possible in PostgreSQL.

However, you can use dblink for creating query between multidatabase as 
given below:

select empno from dblink('dbname=edb','SELECT empno from emp') as 
emp(empno numeric)
select empno from dblink('dbname=enterprisedb','SELECT empno from emp') 
as emp(empno numeric);

where edb and enterprisedb are database names

For More information about dblink, please follow the link given below:

Vibhor Kumar

Mauro Bertoli wrote:
> Hi all,
> is possible in PostgreSQL to create query between multidatabase like Sql Server 2005?
> An example:
> FROM db1.a 
> FROM db2.b
> Where "db1" is a database and "db2" is another database. "a" is a table in database "db1" and "b" is a table in database "db2"
> Best regards,
> Mauro

In response to

pgsql-general by date

Next:From: Dhaval JaiswalDate: 2009-03-28 00:37:07
Subject: Re: Determining PUBLIC's permissions
Previous:From: Dhaval JaiswalDate: 2009-03-27 23:50:25
Subject: Re: Installation Error, Server Won't Start

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group