pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Antti Ijäs <antti.ijas@arcada.fi>
Cc: pgsql-sql@postgresql.org
Subject: Re: Foreign key from another database
Date: 03 Apr 2003 13:42:06 -0500
Message-ID: <1049395325.23833.2.camel@jester> (raw)
In-Reply-To: <42ee0b8a.0304030116.68199b0c@posting.google.com>
References: <42ee0b8a.0304030116.68199b0c@posting.google.com>
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@postgresql.org)
--
Rod Taylor <rbt@rbt.ca>
PGP Key: http://www.rbt.ca/rbtpub.asc
Attachments:
signature.asc (application/pgp-signature, 186B) download
view thread (4+ messages) latest in thread
Message-ID: <1049395325.23833.2.camel@jester> Permalink: ../1049395325.23833.2.camel@jester/ Also on: postgresql.org/message-id/1049395325.23833.2.camel@jester ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients using the --to and --cc options: reply via email To: pgsql-sql@postgresql.org Cc: rbt@rbt.ca, antti.ijas@arcada.fi Subject: Re: Foreign key from another database In-Reply-To: <1049395325.23833.2.camel@jester> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox