Re: Foreign key from another database

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Antti Ijäs <antti(dot)ijas(at)arcada(dot)fi>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Foreign key from another database
Date: 2003-04-03 18:42:06
Message-ID: 1049395325.23833.2.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You might want to look into using multiple schemas in a single database
rather than multiple databases.

If you switch to the above, then you can do what you're looking for.
Postgresql has limited cross database abilities (contrib/dblink), but
not cross database foreign keys.

On Thu, 2003-04-03 at 04:16, Antti Ijäs wrote:
> Hi,
>
> Can I have a reference (with cascading), to another database? Let me
> try to explain the situation a little better ;-)
>
> I have a "main" database, clients. Then I have another database. Let's
> call that program1. In program1 I have a table pTable and in clients I
> have a table namned Client. Like this:
>
> \c clients
> CREATE TABLE Client (
> CustId Serial PRIMARY KEY,
> ....
> );
>
> \c program1
> CREATE TABLE pTable (
> pId SERIAL PRIMARY KEY,
> CustId INTEGER,
> ....
> );
>
> I would like the data to be dropped in pTable automatically, when the
> client is deleted....
>
> / Antti
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2003-04-03 18:54:05 Re: pesky plpgsql
Previous Message Victor Yegorov 2003-04-03 18:38:48 Re: auto-commit