pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ed Loehr <eloehr@austin.rr.com>
To: Constantin Teodorescu <teo@flex.ro>
Cc: PostgreSQL Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: [INTERFACES] A question on triggers
Date: Wed, 16 Feb 2000 10:23:49 -0600
Message-ID: <38AACF15.E7148A20@austin.rr.com> (raw)
References: <38AAAD16.C05F47C3@flex.ro>

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



view thread (6+ messages)  latest in thread

Message-ID: <38AACF15.E7148A20@austin.rr.com>
Permalink:  ../38AACF15.E7148A20@austin.rr.com/
Also on:    postgresql.org/message-id/38AACF15.E7148A20@austin.rr.com

 · 

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-interfaces@postgresql.org
  Cc: eloehr@austin.rr.com, teo@flex.ro
  Subject: Re: [INTERFACES] A question on triggers
  In-Reply-To: <38AACF15.E7148A20@austin.rr.com>

* 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