Re: Linking Tables from 2 databases - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Linking Tables from 2 databases
Date
Msg-id b42b73150607191934y7b981e4cra44be9d7068dd026@mail.gmail.com
Whole thread Raw
In response to Linking Tables from 2 databases  ("Pratik Shukla" <pratikshukla@hotmail.com>)
List pgsql-general
On 7/19/06, Pratik Shukla <pratikshukla@hotmail.com> wrote:
> I have created a DB1 with several tables. Now i need to create another DB2
> with a linked table from DB1. So if there is a table_X in DB1, is there a
> way to import that table_X into DB2 so that any changes made to table_X in
> DB1 will also apply to DB2?

that sounds a lot like replication. check out slony.  for a slightly
slimper alternative you may consider not using two databases, make two
schemas inside your database.  now you can link your tables via simple
trigger.  open up the documentation and read up on schemas and make
sure this is not the right solution for you.

> table_X has references to other tables in DB1 as well...will these
> references be maintained if table_X is imported to DB2?

it's not quite clear what your are asking...I don't understand what
your concept of a reference is.  if you are replicating, generally you
always make changes to one table and the other is a slave.

merlin

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: apparent wraparound
Next
From: "surabhi.ahuja"
Date:
Subject: psql seems to hang during delete query