From: Tom Lane <tgl@sss.pgh.pa.us>
To: Constantin Teodorescu <teo@flex.ro>
Cc: Ed Loehr <eloehr@austin.rr.com>
Cc: PostgreSQL Interfaces <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] A question on triggers
Date: Wed, 16 Feb 2000 17:13:13 -0500
Message-ID: <4624.950739193@sss.pgh.pa.us> (raw)
In-Reply-To: <38AAEB22.19CF1C6B@flex.ro>
References: <38AAAD16.C05F47C3@flex.ro>
<38AACF15.E7148A20@austin.rr.com>
<38AAEB22.19CF1C6B@flex.ro>
>>>> 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?
> But wouldn't be nice if PostgreSQL could offer a more elegant solution?
Can't you do it with the normal GRANT/REVOKE access-control mechanism?
I'm pretty sure that for rules (views), the access rights for queries
issued within the rule are checked based on the owner of the rule, not
the user who invoked the rule. Triggers ought to work the same way,
though I haven't tried it. So you could make the trigger function and
the protected table owned by the same user, and then not grant write
permission on that table to anyone else.
regards, tom lane
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: tgl@sss.pgh.pa.us, teo@flex.ro, eloehr@austin.rr.com
Subject: Re: [INTERFACES] A question on triggers
In-Reply-To: <4624.950739193@sss.pgh.pa.us>
* 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