Re: select query that would join two databases

Lists: pgsql-sql
From: "Keith H(dot)K(dot) Lam (U1 Tech(dot))" <keithhk_lam(at)u1technology(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: select query that would join two databases
Date: 2003-07-30 11:28:04
Message-ID: E1710B82E845F2439B63043F1699E82877C29F@mailserver.tainam.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

dear all,

How to create a query that would join two databases? In MSSQL, i use

select * from dbA.dbo.tableA a dbB.dbo.tableB b where a.id=b.id

Is there anyway to write the above query in postgressql ?

Please email me back.
Thanks,
Keith


From: Rod Taylor <rbt(at)rbt(dot)ca>
To: "Keith H(dot)K(dot) Lam (U1 Tech(dot))" <keithhk_lam(at)u1technology(dot)com>
Cc: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: select query that would join two databases
Date: 2003-08-01 00:39:32
Message-ID: 1059698371.33557.11.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Take a look at the dblink() contrib module.

PostgreSQL does not currently support inter-database joins BUT it does
offer Schemas which is often enough. Take each of your source databases
and toss them into two different schemas of the same database.

On Wed, 2003-07-30 at 07:28, Keith H.K. Lam (U1 Tech.) wrote:
> dear all,
>
> How to create a query that would join two databases? In MSSQL, i use
>
> select * from dbA.dbo.tableA a dbB.dbo.tableB b where a.id=b.id
>
> Is there anyway to write the above query in postgressql ?
>
> Please email me back.
> Thanks,
> Keith
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>