Re: query - Mailing list pgsql-general

From Scott Marlowe
Subject Re: query
Date
Msg-id 1125602520.28179.171.camel@state.g2switchworks.com
Whole thread Raw
In response to query  (Federico Balbi <fbalbi@cs.utsa.edu>)
List pgsql-general
On Thu, 2005-09-01 at 13:34, Federico Balbi wrote:
> Hi,
>   I was just wondering if postgresql supports queries between servers in
> order to pull info from different machines.
> Let's say server A can run a query against server B... something like:
>
> server1 running a SELECT * FROM server2.table
>
> or joins
>
> SELECT A.name, B.name FROM server1.table A, server2.table B WHERE A.id=B.id

No, not directly.  The two solutions are:

use two schemas, not two db servers, and use that.  Then the query would
be the same, but instead of server1 and server2, it would be schema1 and
schema2.

OR

use the dblink module.

the dblink module does NOT allow you to rollback the transaction
entirely, because the transaction semantics across machines aren't there
or in it.

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: query
Next
From: Steve Crawford
Date:
Subject: ODBC and inappropriate select *