Thread: select between two databases

select between two databases

From
Date:
Dear Support,
 
I don't know how I can select between two databases on the same postgres-server? Does postgres support it? I have tested some ways but none of them was right:
 
SELECT s.adresscode FROM db02.adressen a,sachbearbeiter s WHERE a.adresscode=s.adresscode
Error message: Namespace "db02" does not exist
 
SELECT '' FROM db02.adressen
Error message: Namespace "db02" does not exist
 
Thanks a lot in Advance
Andreas Hitter
hmd-software AG
Munich - Germany


To: pgsql-odbc@postgresql.org
    inoue@postgresql.org

Re: select between two databases

From
Bruce Momjian
Date:
The best way is to use /contrib/dblink in the source tree.  In 7.3, you
can even return tables, not just single variables.

---------------------------------------------------------------------------

a.hitter@hmd-software.com wrote:
> Dear Support,
>
> I don't know how I can select between two databases on the same postgres-server? Does postgres support it? I have
testedsome ways but none of them was right: 
>
> SELECT s.adresscode FROM db02.adressen a,sachbearbeiter s WHERE a.adresscode=s.adresscode
> Error message: Namespace "db02" does not exist
>
> SELECT '' FROM db02.adressen
> Error message: Namespace "db02" does not exist
>
> Thanks a lot in Advance
> Andreas Hitter
> hmd-software AG
> Munich - Germany
>
> To: pgsql-odbc@postgresql.org
>     inoue@postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073