X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C996C4758F1 for ; Thu, 3 Apr 2003 17:02:29 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 9D899476334 for ; Thu, 3 Apr 2003 17:02:15 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 81A6243A911; Thu, 3 Apr 2003 17:02:15 -0500 (EST) From: CoL X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Foreign key from another database Date: Fri, 04 Apr 2003 00:09:01 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 32 Message-ID: References: <42ee0b8a.0304030116.68199b0c@posting.google.com> Reply-To: col@mportal.hu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: hu, en-us, en In-Reply-To: <42ee0b8a.0304030116.68199b0c@posting.google.com> To: pgsql-sql@postgresql.org X-Spam-Status: No, hits=-31.5 required=5.0 tests=BAYES_10,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA 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/97 X-Sequence-Number: 12798 Use trigger on Client after delete, and dblink from contrib. C. Antti Ij=E4s wrote, On 4/3/2003 11:16 AM: > 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