Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id BBC4F633132 for ; Thu, 13 Aug 2009 20:30:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 48266-01 for ; Thu, 13 Aug 2009 23:30:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from QMTA13.emeryville.ca.mail.comcast.net (qmta13.emeryville.ca.mail.comcast.net [76.96.27.243]) by mail.postgresql.org (Postfix) with ESMTP id 74754633F76 for ; Thu, 13 Aug 2009 20:30:44 -0300 (ADT) Received: from OMTA04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by QMTA13.emeryville.ca.mail.comcast.net with comcast id TqXc1c00D0lTkoCADzWjFE; Thu, 13 Aug 2009 23:30:43 +0000 Received: from tucker.local ([24.17.164.54]) by OMTA04.emeryville.ca.mail.comcast.net with comcast id TzWi1c0011Ak4z48QzWi0N; Thu, 13 Aug 2009 23:30:42 +0000 From: Adrian Klaver To: pgsql-sql@postgresql.org Subject: Re: mail alert Date: Thu, 13 Aug 2009 16:30:41 -0700 User-Agent: KMail/1.9.10 References: <4A821D12.3050500@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908131630.41508.aklaver@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.247 tagged_above=-10 required=5 tests=AWL=1.352, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/73 X-Sequence-Number: 32982 On Wednesday 12 August 2009 6:27:25 am Jan Verheyden wrote: > Hi, > > I got a bit stuck... > I was looking for a solution for option a) > > Maybe I'll first explain the situation a bit more: > > I have one database for patient registration > Another one for image storage > And a third one for book keeping > A patient should be registered first before the images are stored, so if > there is a new line in the second database with an id which does not exist > yet, it has to be notified in the book keeping database. > > Now the questions: > 1) Can I do this with the inner join (tables subject_id from DB1, pat_id > from DB2), there it is two different databases 2) Once it is notified in > the book keeping that is not registered yet, is it best to poll on this > column to send a warning, or use a trigger?? > > Thanks!! > If at all possible, try to move all that information into schema's of one database. As it stands now you have a lot of moving parts to keep track of via external processes. It is possible but you lose transactional support and trust me that turns into a royal pain. -- Adrian Klaver aklaver@comcast.net