Received: from Mail.austin.rr.com (sm2.texas.rr.com [24.93.35.55]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA43324 for ; Wed, 16 Feb 2000 11:23:20 -0500 (EST) (envelope-from eloehr@austin.rr.com) Received: from austin.rr.com ([24.27.34.146]) by Mail.austin.rr.com with Microsoft SMTPSVC(5.5.1877.197.19); Wed, 16 Feb 2000 10:11:25 -0600 Sender: ed Message-ID: <38AACF15.E7148A20@austin.rr.com> Date: Wed, 16 Feb 2000 10:23:49 -0600 From: Ed Loehr X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Constantin Teodorescu CC: PostgreSQL Interfaces Subject: Re: [INTERFACES] A question on triggers References: <38AAAD16.C05F47C3@flex.ro> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Constantin Teodorescu wrote: > > I have two tables "inputs" and "outputs" and they hold items and > quantities that are coming and going from a warehouse. > > I have defined also another table "stock" that will hold the inventory > of that warehouse. > > I have defined triggers on INSERT, UPDATE and DELETE on "inputs" and > "outputs" tables that update acordingly the "stock" table! > > What's my problem? > > Is there any chance to restrict the direct updates of any user to the > "stock" table? > So that the information in the "stock" table should be updated ONLY by > those triggers? Just for kicks, here's a hack. Add a column named 'passwd' to the stock table (with a bogus default value), then create an UPDATE trigger on stock requiring the UPDATE to include a valid 'passwd' column value that's only known (hard-coded) to your 'inputs' and 'outputs' triggers. Would that work? Cheers, Ed Loehr