Re: Cross database queries

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: <postgresql(at)bryden(dot)co(dot)za>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cross database queries
Date: 2005-08-09 14:41:37
Message-ID: BF1E38E1.C02B%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/9/05 10:21 AM, "postgresql(at)bryden(dot)co(dot)za" <postgresql(at)bryden(dot)co(dot)za>
wrote:

> Hi
>
> Suppose I have two databases on one server (lets call them DB_A and DB_B)
> and I was to write a cross database query. How do I do this in PostgreSQL?
>
> On MS-SQL I would do something like:
>
> SELECT ta.Field1, ta.Field2, tb.Field2
> FROM DB_A.dbo.SomeTable ta
> JOIN DB_B.dbo.SomeOtherTable tb
> ON ta.Field1 = tb.Field1

See /contrib/dblink in the postgresql source distribution.

Sean

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Boes 2005-08-09 14:45:52 Reference new.* or old.* in dynamic statement?
Previous Message Michael Fuhr 2005-08-09 14:35:21 Re: Query stucked in pg_stat_activity