X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7069E3A5A82 for ; Tue, 11 Jan 2005 21:22:56 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82882-02 for ; Tue, 11 Jan 2005 21:22:51 +0000 (GMT) Received: from laptop.kieser.net (kieser2.demon.co.uk [80.176.229.121]) by svr1.postgresql.org (Postfix) with ESMTP id A8BB13A5AC0 for ; Tue, 11 Jan 2005 21:22:49 +0000 (GMT) Received: from [127.0.0.1] (laptop.kieser2.demon.co.uk [127.0.0.1]) by laptop.kieser.net (Postfix) with ESMTP id 8D03C18340; Tue, 11 Jan 2005 21:23:15 +0000 (GMT) Message-ID: <41E443C2.3090800@kieser.net> Date: Tue, 11 Jan 2005 21:23:14 +0000 From: Bradley Kieser User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en, en-us MIME-Version: 1.0 To: Bruno Wolff III Cc: Tad Marko , Michael Fuhr , pgsql-admin@postgresql.org Subject: Re: Limiting user privileges References: <1105377550.11245.0.camel@boojiboy.metrosplash.com> <20050110183111.GA2279@winnie.fuhr.org> <1105475175.8275.7.camel@boojiboy.metrosplash.com> <20050111211839.GC19876@wolff.to> In-Reply-To: <20050111211839.GC19876@wolff.to> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.331 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/72 X-Sequence-Number: 15931 Or, the best way is to use views and not grant any priviledges on the table. The view must be created by the table owner and then grant priviledges on that view to a user. You can then create more than one view if you need, or else you can set up rules, triggers and procedures to implement what you want to implement. This means, for exmample, that if you have a user table that contains the priviledges that a user might have, you can join in that table in the view using current_user to get to the row for the present user and set behaviour accordingly. Bruno Wolff III wrote: >On Tue, Jan 11, 2005 at 14:26:15 -0600, > Tad Marko wrote: > > >>I can >> >>GRANT ALL ON a_specific_table TO user >> >>but I can't figure out how to simply give some privilege to a user on >>all tables. >> >> > >You can't do it with a single GRANT statement. You need to write a script >or function to do it. > >---------------------------(end of broadcast)--------------------------- >TIP 8: explain analyze is your friend > > >