Re: Link tables from different databases - Mailing list pgsql-general

From Reece Hart
Subject Re: Link tables from different databases
Date
Msg-id 1211151765.6875.12.camel@snafu
Whole thread Raw
In response to Re: Link tables from different databases  (Shane Ambler <pgsql@Sheeky.Biz>)
List pgsql-general
> I want it so that every operation on db1.table1 (ie. INSERT, UPDATE, DELETE)
> also happens to db2.table2, but similarly I want it that application can do
> those operations on db2.table2 but actually it does it on db1.table1 behind
> the scene.

If the tables could be in the same database but in different schemas,
you should be able to arrange a view in schema2 (called "table2") with
rules that operate on table1 in schema1. See the manual for a discuss of
rules and views.

If you really want these tables in separate *databases* (same machine or
not), then you probably want dblink, a stiff drink, and a long-hard
think about the prudence of such a design.

-Reece

--
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0


pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: tsearch2 on-demand dictionary loading & using functions in tsearch2
Next
From: Klint Gore
Date:
Subject: Re: triggers: dynamic references to fields in NEW and OLD?