X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D2D884762A2 for ; Thu, 3 Apr 2003 13:42:26 -0500 (EST) Received: from jester.inquent.com (unknown [216.208.117.7]) by postgresql.org (Postfix) with ESMTP id AC297475D3B for ; Thu, 3 Apr 2003 13:41:54 -0500 (EST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h33Ig6gC024458; Thu, 3 Apr 2003 13:42:06 -0500 (EST) (envelope-from rbt@rbt.ca) Subject: Re: Foreign key from another database From: Rod Taylor To: Antti =?ISO-8859-1?Q?Ij=E4s?= Cc: pgsql-sql@postgresql.org In-Reply-To: <42ee0b8a.0304030116.68199b0c@posting.google.com> References: <42ee0b8a.0304030116.68199b0c@posting.google.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ikQzz2xBPccm+mY/U2tM" Organization: Message-Id: <1049395325.23833.2.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Apr 2003 13:42:06 -0500 X-Spam-Status: No, hits=-45.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/47 X-Sequence-Number: 12748 --=-ikQzz2xBPccm+mY/U2tM Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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.=20 Postgresql has limited cross database abilities (contrib/dblink), but not cross database foreign keys. On Thu, 2003-04-03 at 04:16, Antti Ij=E4s wrote: > Hi, >=20 > Can I have a reference (with cascading), to another database? Let me > try to explain the situation a little better ;-) >=20 > 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: >=20 > \c clients > CREATE TABLE Client ( > CustId Serial PRIMARY KEY, > .... > ); >=20 > \c program1 > CREATE TABLE pTable ( > pId SERIAL PRIMARY KEY, > CustId INTEGER,=20 > .... > ); >=20 > I would like the data to be dropped in pTable automatically, when the > client is deleted.... >=20 > / Antti >=20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) --=20 Rod Taylor PGP Key: http://www.rbt.ca/rbtpub.asc --=-ikQzz2xBPccm+mY/U2tM Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+jIB96DETLow6vwwRAvnBAJsH99ITv0SRAL7/+I0XJCgGq1BmNQCfTePm yimcqkn5AcvmoxGua8JhT4Q= =WNKZ -----END PGP SIGNATURE----- --=-ikQzz2xBPccm+mY/U2tM--