X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 016D39DC893 for ; Mon, 27 Feb 2006 08:22:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13351-05 for ; Mon, 27 Feb 2006 08:22:31 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E92939DC81A for ; Mon, 27 Feb 2006 08:22:26 -0400 (AST) Received: from bunyip.lochness.weebeastie.net (nessie.weebeastie.net [220.233.7.36]) by svr4.postgresql.org (Postfix) with ESMTP id 9ACD25AF0AE for ; Mon, 27 Feb 2006 12:22:30 +0000 (GMT) Received: from hogarth by bunyip.lochness.weebeastie.net with local (Exim 4.50) id 1FDhOs-0002l4-HX; Mon, 27 Feb 2006 23:22:50 +1100 Date: Mon, 27 Feb 2006 23:22:50 +1100 From: CaT To: Dayo Johnson Cc: pgsql-admin@postgresql.org Subject: Re: Priviliges and Roles Message-ID: <20060227122250.GG2905@zip.com.au> References: <4402EC0C.9030903@cleanjohn.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4402EC0C.9030903@cleanjohn.net> Organisation: Furball Inc. User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200602/316 X-Sequence-Number: 20737 On Mon, Feb 27, 2006 at 12:09:48PM +0000, Dayo Johnson wrote: > Hello, > > Is it possible to do the following: > Disallow permission to write to a table (either by UPDATE or INSERT) but > allow EXECUTE permission on a Function that writes to the table ? > > The reason I want to do this is so that I can perform certain checks on > the data that is being written before I allow it to be written. I'm no expert but check out triggers. That should allow you to whatnot the data and fail/pass the insert or update. See: http://www.postgresql.org/docs/8.1/interactive/triggers.html -- "To the extent that we overreact, we proffer the terrorists the greatest tribute." - High Court Judge Michael Kirby