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 EA9B63A5AE3 for ; Tue, 11 Jan 2005 21:49:41 +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 85396-09 for ; Tue, 11 Jan 2005 21:49:31 +0000 (GMT) Received: from out012.verizon.net (out012pub.verizon.net [206.46.170.137]) by svr1.postgresql.org (Postfix) with ESMTP id 7900F3A5AE1 for ; Tue, 11 Jan 2005 21:49:32 +0000 (GMT) Received: from boojiboy.metrosplash.com ([66.15.181.204]) by out012.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050111214932.DPAY10436.out012.verizon.net@boojiboy.metrosplash.com>; Tue, 11 Jan 2005 15:49:32 -0600 Subject: Re: Limiting user privileges From: Tad Marko To: Bradley Kieser Cc: Bruno Wolff III , pgsql-admin@postgresql.org In-Reply-To: <41E443C2.3090800@kieser.net> References: <1105377550.11245.0.camel@boojiboy.metrosplash.com> <20050110183111.GA2279@winnie.fuhr.org> <1105475175.8275.7.camel@boojiboy.metrosplash.com> <20050111211839.GC19876@wolff.to> <41E443C2.3090800@kieser.net> Content-Type: text/plain Date: Tue, 11 Jan 2005 15:49:32 -0600 Message-Id: <1105480172.8275.27.camel@boojiboy.metrosplash.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out012.verizon.net from [66.15.181.204] at Tue, 11 Jan 2005 15:49:32 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.038 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/75 X-Sequence-Number: 15934 On Tue, 2005-01-11 at 21:23 +0000, Bradley Kieser wrote: > 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. OK...I think... I'm not understanding something well enough. In MySQL (the only DB I'm very familiar with), I can create a database, import tables, create a user, and then GRANT ALL ON dbname.* TO whateveruser and then whateveruser is essentially the super user on that database. I think that I understand that in PostgreSQL, I need to make whateveruser the owner of the database, then I won't have to go through the GRANT step for him. But, what do I need to do if I need to say easily create users that have INSERT and SELECT privileges on all (of a large number of) tables in a given database? Thanks, Tad -- Tad Marko