Received: from flex.flex.ro (IDENT:root@[193.230.255.4]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA16436 for ; Thu, 17 Feb 2000 13:05:13 -0500 (EST) (envelope-from teo@flex.ro) Received: from flex.ro (IDENT:teo@teo.flex.ro [193.230.255.3]) by flex.flex.ro (8.9.3/8.9.3) with ESMTP id VAA26682; Thu, 17 Feb 2000 21:08:16 +0200 Sender: teo@flex.flex.ro Message-ID: <38AC3840.EB320B34@flex.ro> Date: Thu, 17 Feb 2000 20:04:48 +0200 From: Constantin Teodorescu X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14 i586) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane CC: Ed Loehr , PostgreSQL Interfaces Subject: Re: [INTERFACES] A question on triggers References: <38AAAD16.C05F47C3@flex.ro> <38AACF15.E7148A20@austin.rr.com> <38AAEB22.19CF1C6B@flex.ro> <4624.950739193@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tom Lane wrote: > > >>>> 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? No. It didn't worked, that was my first idea! > 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. It seems it didn't work! Constantin Teodorescu